Add grammar to tags. Also: respect custom tag slugs on publishing.
[wolnelektury.git] / src / newsletter / forms.py
index 16f216e..fc1e4e3 100644 (file)
@@ -30,9 +30,10 @@ WiÄ™cej informacji w <a href="https://nowoczesnapolska.org.pl/prywatnosc/">polit
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
         # Move the newsletter field to the end.
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
         # Move the newsletter field to the end.
-        f = self.fields['agree_newsletter']
-        del self.fields['agree_newsletter']
-        self.fields['agree_newsletter'] = f
+        if 'agree_newsletter' in self.fields:
+            f = self.fields['agree_newsletter']
+            del self.fields['agree_newsletter']
+            self.fields['agree_newsletter'] = f
     
     @property
     def data_processing(self):
     
     @property
     def data_processing(self):