diff --git a/suchwowx/models.py b/suchwowx/models.py
index c921084..5eec059 100644
--- a/suchwowx/models.py
+++ b/suchwowx/models.py
@@ -27,12 +27,12 @@ class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
- register_date = db.Column(db.DateTime, default=datetime.utcnow())
+ register_date = db.Column(db.DateTime, default=datetime.utcnow)
last_login_date = db.Column(db.DateTime, nullable=True)
verified = db.Column(db.Boolean, default=False)
public_address = db.Column(db.String(180))
nonce = db.Column(db.String(180), default=rand_id())
- nonce_date = db.Column(db.DateTime, default=datetime.utcnow())
+ nonce_date = db.Column(db.DateTime, default=datetime.utcnow)
handle = db.Column(db.String(40), unique=True)
bio = db.Column(db.String(600), nullable=True)
profile_image = db.Column(db.String(300), nullable=True)
@@ -95,7 +95,7 @@ class Meme(db.Model):
__tablename__ = 'memes'
id = db.Column(db.String(80), default=rand_id, primary_key=True)
- create_date = db.Column(db.DateTime, default=datetime.utcnow())
+ create_date = db.Column(db.DateTime, default=datetime.utcnow)
file_name = db.Column(db.String(200), unique=True)
meta_ipfs_hash = db.Column(db.String(100), unique=True, nullable=True)
meme_ipfs_hash = db.Column(db.String(100), unique=True, nullable=True)
diff --git a/suchwowx/routes/api.py b/suchwowx/routes/api.py
index d598657..cbf65cb 100644
--- a/suchwowx/routes/api.py
+++ b/suchwowx/routes/api.py
@@ -54,6 +54,14 @@ def update_user():
if _u:
if current_user.id == _u.id:
+ user_exists = User.query.filter(
+ User.handle == data['handle']
+ ).first()
+ if user_exists and not current_user.id == user_exists.id:
+ return jsonify({
+ 'success': False,
+ 'message': 'That user handle already exists on this server'
+ })
_u.wownero_address = data['wownero_address']
_u.ipfs_hash = data['ipfs_hash']
_u.handle = data['handle']
diff --git a/suchwowx/static/css/custom.css b/suchwowx/static/css/custom.css
index 53be0d1..afdf0e6 100644
--- a/suchwowx/static/css/custom.css
+++ b/suchwowx/static/css/custom.css
@@ -23,3 +23,7 @@
max-height: 200px;
object-fit: cover;
}
+
+.wrap {
+ word-wrap: break-word;
+}
diff --git a/suchwowx/templates/profile.html b/suchwowx/templates/profile.html
index 88efd2b..13f1cff 100644
--- a/suchwowx/templates/profile.html
+++ b/suchwowx/templates/profile.html
@@ -15,13 +15,13 @@
From Avax Chain
-Handle: ?
-Wownero Address: ?
-Profile IPFS Hash: ?
-Tipped AVAX: ?
-Tipped WOWX: ?
-Tipped WOW: ?
+From Avalanche Blockchain
+Handle: ?
+Wownero Address: ?
+Profile IPFS Hash: ?
+Tipped AVAX: ?
+Tipped WOWX: ?
+Tipped WOW: ?
From Local Database
@@ -37,26 +37,23 @@Wownero Address: {% if is_user %} - + Publish AVAX {% else %} - {{ user.wownero_address }} + {{ user.wownero_address }} {% endif %}
Metadata IPFS Hash: {% if is_user %} - + Publish AVAX {% else %} {{ user.ipfs_hash }} {% endif %}
- {% if is_user %} - - {% endif %}Register Date: {{ user.register_date }}
-Login Date: {{ user.last_login_date }}
+Last Login Date: {{ user.last_login_date }}
Moderator: {{ user.is_moderator() }}
Verified: {{ user.verified }}
Memes Posted: {{ user.memes | length }}
@@ -66,6 +63,9 @@ {% if user.website %}Website: {{ user.website_url }}
{% endif %} + {% if is_user %} + + {% endif %}