Skip to content
Browse files

fixes #225 script generated pages don't fail anymore if saved

  • Loading branch information...
1 parent d97f3c8 commit db8f8b2def304cb71cb8b5d50d153ba3c6320bcf @digi604 digi604 committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 cms/models/pagemodel.py
View
7 cms/models/pagemodel.py
@@ -278,8 +278,11 @@ def save(self, no_signals=False, change_state=True, commit=True, force_with_mode
self.reverse_id = None
from cms.utils.permissions import _thread_locals
-
- self.changed_by = _thread_locals.user.username
+ user = getattr(_thread_locals, "user", None)
+ if user:
+ self.changed_by = user.username
+ else:
+ self.changed_by = "script"
if not self.pk:
self.created_by = self.changed_by

0 comments on commit db8f8b2

Please sign in to comment.
Something went wrong with that request. Please try again.