diff --git a/main.py b/main.py index cf65b23..4fa7395 100644 --- a/main.py +++ b/main.py @@ -422,7 +422,6 @@ def admin_new_forum(): @app.route('/admin/config/edit/', methods = ['POST']) def admin_edit_config(): - print('what') chk, user = _admin_check() if not chk: return user @@ -534,8 +533,6 @@ class Comment: self.parent_id = parent_id def create_comment_tree(comments): - comments = [*comments] - print(comments) start = time.time(); # Collect comments first, then build the tree in case we encounter a child before a parent comment_map = { @@ -576,7 +573,7 @@ class User: return self.role == Role.ADMIN def is_banned(self): - return self.banned_until is not None and self.banned_until > time.time_ns() + return self.banned_until > time.time_ns() def get_user(): id = session.get('user_id') diff --git a/schema.txt b/schema.txt index 16fdf27..fdd8869 100644 --- a/schema.txt +++ b/schema.txt @@ -14,7 +14,7 @@ create table users ( about text not null default '', join_time integer not null, role integer not null default 0, - banned_until integer + banned_until integer not null default 0 ); create table threads ( diff --git a/templates/admin/index.html b/templates/admin/index.html index 576ad6e..90a0447 100644 --- a/templates/admin/index.html +++ b/templates/admin/index.html @@ -99,12 +99,12 @@ -{% if banned_until is not none %} +{%- if banned_until > 0 -%}
{{- format_time(banned_until) }}
-{% endif %} +{%- endif -%}