0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

fixup! Add user_has_lock to PagePermissionTester

This commit is contained in:
Karl Hobley 2019-11-26 16:23:08 +00:00
parent c2318b48e6
commit 17f61b5974

View File

@ -1945,7 +1945,7 @@ class PagePermissionTester:
return self.user.is_superuser or ('lock' in self.permissions)
def can_unlock(self):
return self.user.is_superuser or self.page.locked_by_id == self.user.pk or ('unlock' in self.permissions)
return self.user.is_superuser or self.user_has_lock() or ('unlock' in self.permissions)
def can_publish_subpage(self):
"""