diff gpp/gcalendar/forms.py @ 228:d77e0dc772ad

Implement #88; add option to create a new forum thread from a new calendar entry.
author Brian Neal <bgneal@gmail.com>
date Sun, 11 Jul 2010 21:03:41 +0000
parents 7e3ed3eb9b99
children 88b2b9cb8c1f
line wrap: on
line diff
--- a/gpp/gcalendar/forms.py	Tue Jul 06 03:02:20 2010 +0000
+++ b/gpp/gcalendar/forms.py	Sun Jul 11 21:03:41 2010 +0000
@@ -80,7 +80,7 @@
     class Meta:
         model = Event
         fields = ('what', 'start_date', 'start_time', 'end_date', 'end_time',
-            'all_day', 'time_zone', 'where', 'description')
+            'all_day', 'time_zone', 'where', 'description', 'create_forum_thread')
 
     class Media:
         css = {
@@ -123,6 +123,10 @@
 
         super(EventEntryForm, self).__init__(*args, **kwargs)
 
+        # We don't want the user to create a forum thread on an existing event
+        if instance is not None:
+            del self.fields['create_forum_thread']
+
     def clean(self):
         start_date = self.cleaned_data.get('start_date')
         start_time = self.cleaned_data.get('start_time')