mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-10 23:17:37 +01:00
Fix broken includes in user models
This commit is contained in:
parent
dfa5d0c5a7
commit
2ae4a2ed5a
@ -217,6 +217,8 @@ class User(db.Model, UserMixin):
|
|||||||
raise Exception("Permission {} is not related to users".format(perm.name))
|
raise Exception("Permission {} is not related to users".format(perm.name))
|
||||||
|
|
||||||
def canCommentRL(self):
|
def canCommentRL(self):
|
||||||
|
from app.models import ThreadReply
|
||||||
|
|
||||||
factor = 1
|
factor = 1
|
||||||
if self.rank.atLeast(UserRank.ADMIN):
|
if self.rank.atLeast(UserRank.ADMIN):
|
||||||
return True
|
return True
|
||||||
@ -236,6 +238,8 @@ class User(db.Model, UserMixin):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def canOpenThreadRL(self):
|
def canOpenThreadRL(self):
|
||||||
|
from app.models import Thread
|
||||||
|
|
||||||
factor = 1
|
factor = 1
|
||||||
if self.rank.atLeast(UserRank.ADMIN):
|
if self.rank.atLeast(UserRank.ADMIN):
|
||||||
return True
|
return True
|
||||||
@ -262,6 +266,7 @@ class User(db.Model, UserMixin):
|
|||||||
self.checkPerm(current_user, Permission.CHANGE_RANK)
|
self.checkPerm(current_user, Permission.CHANGE_RANK)
|
||||||
|
|
||||||
def can_delete(self):
|
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
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user