We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ee5e4bd + 7ff779b commit 37ddfbbCopy full SHA for 37ddfbb
askbot/models/__init__.py
@@ -527,6 +527,11 @@ def user_has_badge(self, badge):
527
def user_can_anonymize_account(self, user):
528
"""`True`, if `self` can anonymize and disable account of `user`"""
529
perm = askbot_settings.WHO_CAN_ANONYMIZE_ACCOUNTS
530
+
531
+ # non-admins cannot remove admins or moderators
532
+ if not self.is_administrator() and user.is_administrator_or_moderator():
533
+ return False
534
535
if perm == 'admins':
536
return self.is_administrator() and self.pk != user.pk
537
elif self.is_administrator_or_moderator():
0 commit comments