Fix tag saving during upload

This commit is contained in:
Alexandre Iooss 2021-10-23 17:59:19 +02:00
parent 40365ccc39
commit 097f4f5093

View file

@ -101,10 +101,11 @@ class UploadForm(forms.Form):
# Create new gallery
title = self.cleaned_data.get('new_gallery_title')
gallery = Gallery.objects.create(title=title, slug=slugify(title))
GalleryExtended.objects.create(
ext = GalleryExtended.objects.create(
gallery=gallery,
tags=self.cleaned_data['new_gallery_tags'],
date_start=self.cleaned_data['new_gallery_date_start'],
date_end=self.cleaned_data['new_gallery_date_end'],
)
for tag in self.cleaned_data['new_gallery_tags']:
ext.tags.add(tag)
return gallery