Michael Hall has proposed merging lp:~mhall119/loco-directory/fixes-703172 into
lp:loco-directory.
Requested reviews:
loco-directory-dev (loco-directory-dev)
Related bugs:
#703172 Error when entering other data, but not times
https://bugs.launchpad.net/bugs/703172
For more details, see:
https://code.launchpad.net/~mhall119/loco-directory/fixes-703172/+merge/47293
The problem is that when using the split date/time widget, if time isn't
provided, the resulting datetime form field value will be None. We weren't
checking for None values before trying to convert them from localtime to utc.
--
https://code.launchpad.net/~mhall119/loco-directory/fixes-703172/+merge/47293
Your team loco-directory-dev is requested to review the proposed merge of
lp:~mhall119/loco-directory/fixes-703172 into lp:loco-directory.
=== modified file 'loco_directory/events/forms.py'
--- loco_directory/events/forms.py 2011-01-18 21:13:08 +0000
+++ loco_directory/events/forms.py 2011-01-24 19:07:55 +0000
@@ -75,10 +75,11 @@
def clean(self):
venue = self.cleaned_data.get('venue')
if venue is not None:
- begin = self.cleaned_data.get('date_begin')
- end = self.cleaned_data.get('date_end')
- self.cleaned_data['date_begin'] = venue.fromlocaltime(begin)
- self.cleaned_data['date_end'] = venue.fromlocaltime(end)
+ begin = self.cleaned_data.get('date_begin', None)
+ end = self.cleaned_data.get('date_end', None)
+ if begin is not None and end is not None:
+ self.cleaned_data['date_begin'] = venue.fromlocaltime(begin)
+ self.cleaned_data['date_end'] = venue.fromlocaltime(end)
return self.cleaned_data
def grouped_venue_list(self):
_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help : https://help.launchpad.net/ListHelp