Skip to content

Commit

Permalink
Fix blog post has_change_permission when the object is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninjaclasher authored and Xyene committed May 10, 2020
1 parent 79016fa commit 772fed3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion judge/admin/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class BlogPostAdmin(VersionAdmin):

def has_change_permission(self, request, obj=None):
if obj is None:
return True
return request.user.has_perm('judge.change_blogpost')
return obj.is_editable_by(request.user)


Expand Down

0 comments on commit 772fed3

Please sign in to comment.