Fixed a problem with checking shepherd writeup editing permissions for logged-in users with no associated person object.
- Legacy-Id: 5695
This commit is contained in:
parent
bcee56d238
commit
aff678bb11
|
@ -187,10 +187,15 @@ can_edit_intended_std_level = can_edit_base
|
|||
can_edit_consensus = can_edit_base
|
||||
can_edit_shepherd = can_edit_base
|
||||
|
||||
import debug
|
||||
@debug.trace
|
||||
def can_edit_shepherd_writeup(doc, user):
|
||||
try:
|
||||
person = user.person
|
||||
except Person.DoesNotExist:
|
||||
person = None
|
||||
return user.is_authenticated() and (
|
||||
can_edit_base(doc,user) or
|
||||
(doc.shepherd==user.person)
|
||||
(person and doc.shepherd==person)
|
||||
)
|
||||
|
||||
def nice_consensus(consensus):
|
||||
|
|
Loading…
Reference in a new issue