From 2ae4a2ed5ad37cb212f7cb350b5a7ca58d9627ca Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 10 Dec 2020 23:08:53 +0000 Subject: [PATCH] Fix broken includes in user models --- app/models/users.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/users.py b/app/models/users.py index e53d9183..707548e9 100644 --- a/app/models/users.py +++ b/app/models/users.py @@ -217,6 +217,8 @@ class User(db.Model, UserMixin): raise Exception("Permission {} is not related to users".format(perm.name)) def canCommentRL(self): + from app.models import ThreadReply + factor = 1 if self.rank.atLeast(UserRank.ADMIN): return True @@ -236,6 +238,8 @@ class User(db.Model, UserMixin): return True def canOpenThreadRL(self): + from app.models import Thread + factor = 1 if self.rank.atLeast(UserRank.ADMIN): return True @@ -262,6 +266,7 @@ class User(db.Model, UserMixin): self.checkPerm(current_user, Permission.CHANGE_RANK) def can_delete(self): + from app.models import ForumTopic return self.packages.count() == 0 and ForumTopic.query.filter_by(author=self).count() == 0