diff --git a/files/routes/users.py b/files/routes/users.py index 8abc3654e..985a02bc5 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -53,9 +53,9 @@ def transfer_coins(v, username): amount = request.form.get("amount", "") amount = int(amount) if amount.isdigit() else None - if amount is None or amount <= 0: return {"error": f"Invalid amount of {app.config['SITE_NAME']}coins."}, 400 - if v.coins < amount: return {"error": f"You don't have enough {app.config['SITE_NAME']}coins"}, 400 - if amount < 100: return {"error": f"You have to gift at least 100 {app.config['SITE_NAME']}coins."}, 400 + if amount is None or amount <= 0: return {"error": f"Invalid amount of {app.config['COINS_NAME']}."}, 400 + if v.coins < amount: return {"error": f"You don't have enough {app.config['COINS_NAME']}"}, 400 + if amount < 100: return {"error": f"You have to gift at least 100 {app.config['COINS_NAME']}."}, 400 v.coins -= amount receiver.coins += amount @@ -64,9 +64,9 @@ def transfer_coins(v, username): g.db.commit() - transfer_message = f"🤑 [@{v.username}]({v.url}) has gifted you {amount} {app.config['SITE_NAME']}coins!" + transfer_message = f"🤑 [@{v.username}]({v.url}) has gifted you {amount} {app.config['COINS_NAME']}!" send_notification(v.id, receiver, transfer_message) - return {"message": f"{amount} {app.config['SITE_NAME']}coins transferred!"}, 200 + return {"message": f"{amount} {app.config['COINS_NAME']} transferred!"}, 200 return "", 204 diff --git a/files/templates/header.html b/files/templates/header.html index c8ad70b7f..eb4a80264 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -79,7 +79,7 @@
{{v.username}}
-
{{v.coins}} {{"SITE_NAME" | app_config}}coins
+
{{v.coins}} {{"COINS_NAME" | app_config}}
diff --git a/files/templates/userpage.html b/files/templates/userpage.html index d5116d5df..8b8a420c8 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -25,7 +25,7 @@ -=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers - {% endif %}{% if not u.is_private %}{{u.post_count}} Posts - {{u.comment_count}} Comments - {% endif %}{{u.bio}}" /> +=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers - {% endif %}{% if not u.is_private %}{{u.post_count}} Posts - {{u.comment_count}} Comments - {% endif %}{{u.bio}}" /> @@ -36,7 +36,7 @@ -=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers -{% endif %} {% if not u.is_private %} {{u.post_count}} Posts - {{u.comment_count}} Comments -{% endif %} {{u.bio}}" /> +=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers -{% endif %} {% if not u.is_private %} {{u.post_count}} Posts - {{u.comment_count}} Comments -{% endif %} {{u.bio}}" /> {% endblock %} @@ -151,7 +151,7 @@ {% if u.customtitle %}

{{u.customtitle | safe}}

{% endif %}
- {{u.coins}} {{"SITE_NAME" | app_config}}coins   {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %}joined {{u.created_date}} + {{u.coins}} {{"COINS_NAME" | app_config}}   {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %}joined {{u.created_date}}
{% if u.bio_html %} @@ -172,7 +172,7 @@ Message Get them help - Gift {{"SITE_NAME" | app_config}}coins + Gift {{"COINS_NAME" | app_config}}

 							
@@ -346,7 +346,7 @@
 				{% endif %}
 				{% if u.customtitle %}

{{u.customtitle | safe}}

{% endif %}
- {{u.coins}} {{"SITE_NAME" | app_config}}coins  {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %}
joined {{u.created_date}} + {{u.coins}} {{"COINS_NAME" | app_config}}  {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %}
joined {{u.created_date}}
{% if u.bio_html %}

{{u.bio_html | safe}}