fixed administrator users not being able to create +guilds
This commit is contained in:
parent
e5e15c6b83
commit
22524c5920
3 changed files with 10 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# Changelog
|
||||
|
||||
## 0.3.2
|
||||
|
||||
- Fixed administrator users not being able to create +guilds
|
||||
|
||||
## 0.3.1
|
||||
|
||||
- Fixed a critical bug that prevented database initialization
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from sqlalchemy import select
|
|||
from werkzeug.routing import BaseConverter
|
||||
from sassutils.wsgi import SassMiddleware
|
||||
|
||||
__version__ = '0.3.1'
|
||||
__version__ = '0.3.2'
|
||||
|
||||
APP_BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
|
|
|
|||
|
|
@ -163,8 +163,11 @@ class User(BaseModel):
|
|||
db.session.execute(update(User).where(User.id == self.id).values(karma = self.karma + points))
|
||||
db.session.commit()
|
||||
|
||||
def can_create_community(self):
|
||||
return self.karma > 15
|
||||
def can_create_guild(self):
|
||||
return self.karma > 15 or self.is_administrator
|
||||
|
||||
## deprecated alias!
|
||||
can_create_community = can_create_guild
|
||||
|
||||
def handle(self):
|
||||
return f'@{self.username}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue