diff --git a/app/models.py b/app/models.py index 67a6677..5a4cfac 100644 --- a/app/models.py +++ b/app/models.py @@ -121,12 +121,15 @@ class User(db.Model, UserMixin): packages = db.relationship("Package", backref="author", lazy="dynamic") requests = db.relationship("EditRequest", backref="author", lazy="dynamic") - def __init__(self, username): + def __init__(self, username, active=False, email=None, password=None): import datetime self.username = username self.confirmed_at = datetime.datetime.now() - datetime.timedelta(days=6000) self.display_name = username + self.active = active + self.email = email + self.password = password self.rank = UserRank.NOT_JOINED def canAccessTodoList(self): diff --git a/app/templates/users/claim.html b/app/templates/users/claim.html index f561a89..ae8e9c9 100644 --- a/app/templates/users/claim.html +++ b/app/templates/users/claim.html @@ -95,5 +95,21 @@ Creating an Account + +
+

Option 3 - Email/password sign up

+ +
+

+ Only do this if you don't have a forum account! +

+

+ If you have a forum account, please use one of the other two + options. +

+ + Register +
+
{% endif %} {% endblock %} diff --git a/app/templates/users/user_profile_page.html b/app/templates/users/user_profile_page.html index 304649e..755a158 100644 --- a/app/templates/users/user_profile_page.html +++ b/app/templates/users/user_profile_page.html @@ -32,7 +32,7 @@ Minetest Forum {% elif user == current_user %} - Link Forums Account + No forum account {% endif %} {% if (user.forums_username and user.github_username) or user == current_user %} diff --git a/app/views/__init__.py b/app/views/__init__.py index 21ed40d..09c7be8 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -62,7 +62,11 @@ def flatpage(path): @app.before_request def do_something_whenever_a_request_comes_in(): - if current_user.is_authenticated and current_user.rank == UserRank.BANNED: - flash("You have been banned.", "error") - logout_user() - return redirect(url_for('user.login')) + if current_user.is_authenticated: + if current_user.rank == UserRank.BANNED: + flash("You have been banned.", "error") + logout_user() + return redirect(url_for('user.login')) + elif current_user.rank == UserRank.NOT_JOINED: + current_user.rank = UserRank.MEMBER + db.session.commit()