Skip to content

Commit aff678b

Browse files
committed
Fixed a problem with checking shepherd writeup editing permissions for logged-in users with no associated person object.
- Legacy-Id: 5695
1 parent bcee56d commit aff678b

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

ietf/idrfc/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,15 @@ def can_edit_base(doc, user):
187187
can_edit_consensus = can_edit_base
188188
can_edit_shepherd = can_edit_base
189189

190+
import debug
191+
@debug.trace
190192
def can_edit_shepherd_writeup(doc, user):
193+
try:
194+
person = user.person
195+
except Person.DoesNotExist:
196+
person = None
191197
return user.is_authenticated() and (
192-
can_edit_base(doc,user) or
193-
(doc.shepherd==user.person)
198+
(person and doc.shepherd==person)
194199
)
195200

196201
def nice_consensus(consensus):

0 commit comments

Comments
 (0)