fix ChangeSet.is_author for non-saved changesets
This commit is contained in:
parent
fdf6269000
commit
9ad5c6a5e7
1 changed files with 3 additions and 2 deletions
|
@ -412,8 +412,9 @@ class ChangeSet(models.Model):
|
|||
return self.state in ('finallyrejected', 'applied')
|
||||
|
||||
def is_author(self, request):
|
||||
return (self.author == request.user or (self.author is None and not request.user.is_authenticated and
|
||||
request.session.get('changeset', None) == self.pk))
|
||||
return (self.pk is None or self.author == request.user or
|
||||
(self.author is None and not request.user.is_authenticated and
|
||||
request.session.get('changeset', None) == self.pk))
|
||||
|
||||
def can_see(self, request):
|
||||
return self.is_author(request)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue