Commit f0e04654 authored by Michal Čihař's avatar Michal Čihař

Handle creating change for unautheticated user

Fixes rb#516
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 39c44229
......@@ -128,6 +128,12 @@ class ChangeManager(models.Manager):
return result
def create(self, user=None, **kwargs):
"""Wrapper to avoid using anonymous user as change owner"""
if user is not None and not user.is_authenticated():
user = None
super(ChangeManager, self).create(user=user, **kwargs)
@python_2_unicode_compatible
class Change(models.Model):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment