aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models.py5
-rw-r--r--app/templates/users/claim.html16
-rw-r--r--app/templates/users/user_profile_page.html2
-rw-r--r--app/views/__init__.py12
4 files changed, 29 insertions, 6 deletions
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
<input type="submit" value="Next">
</form>
</div>
+
+ <div class="box box_grey">
+ <h2>Option 3 - Email/password sign up</h2>
+
+ <div class="box-body">
+ <p>
+ <b>Only do this if you don't have a forum account!</b>
+ </p>
+ <p>
+ If you have a forum account, please use one of the other two
+ options.
+ </p>
+
+ <a class="button" href="{{ url_for('user.register') }}">Register</a>
+ </div>
+ </div>
{% 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
</a>
{% elif user == current_user %}
- <a href="">Link Forums Account</a>
+ 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()