diff --git a/photologue_custom/forms.py b/photologue_custom/forms.py index c343d98..11a146d 100644 --- a/photologue_custom/forms.py +++ b/photologue_custom/forms.py @@ -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