mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Add not joined rank
This commit is contained in:
parent
73f24add61
commit
363f9d8016
@ -16,11 +16,12 @@ def url_to_title(url):
|
||||
return url.replace("_", " ")
|
||||
|
||||
class UserRank(enum.Enum):
|
||||
NEW_MEMBER = 0
|
||||
MEMBER = 1
|
||||
EDITOR = 2
|
||||
MODERATOR = 3
|
||||
ADMIN = 4
|
||||
NOT_JOINED = 0
|
||||
NEW_MEMBER = 1
|
||||
MEMBER = 2
|
||||
EDITOR = 3
|
||||
MODERATOR = 4
|
||||
ADMIN = 5
|
||||
|
||||
def atLeast(self, min):
|
||||
return self.value >= min.value
|
||||
@ -59,7 +60,7 @@ class User(db.Model, UserMixin):
|
||||
self.username = username
|
||||
self.confirmed_at = datetime.datetime.now() - datetime.timedelta(days=6000)
|
||||
self.display_name = username
|
||||
self.rank = UserRank.MEMBER
|
||||
self.rank = UserRank.NOT_JOINED
|
||||
|
||||
def isClaimed(self):
|
||||
return self.password is not None and self.password != ""
|
||||
|
@ -13,6 +13,14 @@
|
||||
<td>Name</td>
|
||||
<td>{{ package.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Author</td>
|
||||
<td>
|
||||
<a href="{{ url_for('user_profile_page', username=package.author.username) }}">
|
||||
{{ package.author.display_name }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Type</td>
|
||||
<td>{{ package.type.value }}</td>
|
||||
|
1
setup.py
1
setup.py
@ -14,6 +14,7 @@ if not os.path.isfile("db.sqlite"):
|
||||
|
||||
ruben = User("rubenwardy")
|
||||
ruben.github_username = "rubenwardy"
|
||||
ruben.rank = UserRank.MEMBER
|
||||
db.session.add(ruben)
|
||||
|
||||
jeija = User("Jeija")
|
||||
|
Loading…
Reference in New Issue
Block a user