You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem occurs when a Page is in the 'published'-state but does not have a publication_date set. How can that happen as in the save-Method of class Page publication_date is set when state is 'published'?
This issue might have to do with data not migrated from django-cms 2.0.2
Back then the publication_date was set to NULL on published pages in some cases:
# Drafts should not, unless they have been set to the future
if self.published:
if settings.CMS_SHOW_START_DATE:
if self.publication_date and self.publication_date <= datetime.now():
self.publication_date = None
else:
self.publication_date = None
For me the solution was to set publication_date to all published pages:
Django==1.4.2
django-cms==2.3.3
Environment:
Request Method: GET
Request URL: http://dev.carusocarsharing.com/sitemap.xml
Django Version: 1.4.2
Python Version: 2.7.3
Installed Applications:
('django_extensions',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.gis',
'django.contrib.admin',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'menus',
'sorl.thumbnail',
'cms',
'mptt',
'south',
'appmedia',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'main',
'marketplace',
'convadis',
'smart_selects',
'server',
'rpc4django',
'cmsplugin_news',
'cmsplugin_mediaelements',
'cmsplugin_faq',
'cmsplugin_textwithimage',
'cmsplugin_galleria',
'contact_form',
'djangocms_utils',
'treemenus',
'sekizai',
'reversion',
'workflows',
'permissions',
'tinymce',
'cronjobs',
'compressor')
Installed Middleware:
('django.middleware.cache.UpdateCacheMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.transaction.TransactionMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware')
Traceback:
File "/home/django/.virtualenvs/django14-dev/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
Exception Type: TypeError at /sitemap.xml
Exception Value: can't compare datetime.datetime to NoneType
The text was updated successfully, but these errors were encountered: