mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Prevent deleting banned accounts
This commit is contained in:
parent
a1eac9959e
commit
32a305c9d8
@ -324,7 +324,9 @@ class User(db.Model, UserMixin):
|
||||
|
||||
def can_delete(self):
|
||||
from app.models import ForumTopic
|
||||
return self.packages.count() == 0 and ForumTopic.query.filter_by(author=self).count() == 0
|
||||
return self.packages.count() == 0 and \
|
||||
ForumTopic.query.filter_by(author=self).count() == 0 and \
|
||||
self.rank != UserRank.BANNED
|
||||
|
||||
|
||||
class UserEmailVerification(db.Model):
|
||||
|
Loading…
Reference in New Issue
Block a user