Some publish_date shenanigans

master
Nick Sergeant 2012-07-05 21:22:45 -04:00
parent ebebf56545
commit bbba825a9d
1 changed files with 3 additions and 1 deletions

View File

@ -208,7 +208,9 @@ class PrivateSniptResource(ModelResource):
user=request.user, **kwargs)
def _clean_publish_date(self, bundle):
if bundle.data['blog_post'] and not bundle.data['publish_date']:
if bundle.data['blog_post'] and 'publish_date' not in bundle.data:
bundle.data['publish_date'] = datetime.datetime.now()
elif bundle.data['publish_date'] == '':
bundle.data['publish_date'] = datetime.datetime.now()
elif bundle.data['blog_post']:
c = pdc.Constants()