fsdfds
This commit is contained in:
parent
bf91a990f2
commit
c8df6e2b17
3 changed files with 11 additions and 9 deletions
|
@ -203,14 +203,14 @@ def settings_profile_post(v):
|
||||||
|
|
||||||
if bans:
|
if bans:
|
||||||
ban = bans[0]
|
ban = bans[0]
|
||||||
reason = f"Remove the {ban.domain} link from your top 8 friends list and try again."
|
reason = f"Remove the {ban.domain} link from your top friends list and try again."
|
||||||
if ban.reason: reason += f" {ban.reason}"
|
if ban.reason: reason += f" {ban.reason}"
|
||||||
return {"error": reason}, 401
|
return {"error": reason}, 401
|
||||||
|
|
||||||
if len(friends_html) > 2000:
|
if len(friends_html) > 2000:
|
||||||
return render_template("settings_profile.html",
|
return render_template("settings_profile.html",
|
||||||
v=v,
|
v=v,
|
||||||
error="Your top 8 friends list is too long")
|
error="Your top friends list is too long")
|
||||||
|
|
||||||
|
|
||||||
notify_users = set()
|
notify_users = set()
|
||||||
|
@ -222,8 +222,10 @@ def settings_profile_post(v):
|
||||||
|
|
||||||
if request.host == 'rdrama.net' and 'aevann' in friends_html.lower() and 1 not in notify_users: notify_users.add(1)
|
if request.host == 'rdrama.net' and 'aevann' in friends_html.lower() and 1 not in notify_users: notify_users.add(1)
|
||||||
|
|
||||||
for x in notify_users: send_notification(x, f"@{v.username} has added you to their top 8 friends!")
|
for x in notify_users:
|
||||||
|
message = f"@{v.username} has added you to their top friends!"
|
||||||
|
existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == NOTIFICATIONS_ACCOUNT, Comment.body == message, Comment.notifiedto == x).first()
|
||||||
|
if not existing: send_notification(x, message)
|
||||||
|
|
||||||
v.friends = friends[:500]
|
v.friends = friends[:500]
|
||||||
v.friends_html=friends_html
|
v.friends_html=friends_html
|
||||||
|
@ -231,7 +233,7 @@ def settings_profile_post(v):
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return render_template("settings_profile.html",
|
return render_template("settings_profile.html",
|
||||||
v=v,
|
v=v,
|
||||||
msg="Your top 8 friends have been updated.")
|
msg="Your top friends have been updated.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -590,13 +590,13 @@
|
||||||
|
|
||||||
<div class="body d-lg-flex border-bottom">
|
<div class="body d-lg-flex border-bottom">
|
||||||
|
|
||||||
<label class="text-black w-lg-25">Top 8 friends</label>
|
<label class="text-black w-lg-25">Top friends</label>
|
||||||
|
|
||||||
<div class="w-lg-100">
|
<div class="w-lg-100">
|
||||||
<form id="profile-friends" action="/settings/profile" method="post" enctype="multipart/form-data">
|
<form id="profile-friends" action="/settings/profile" method="post" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<div class="input-group mb-2">
|
<div class="input-group mb-2">
|
||||||
<textarea id="friends-text" class="form-control rounded" aria-label="With textarea" placeholder="Enter your top 8 friends on the site..." rows="3" name="friends" form="profile-friends" maxlength="1500">{% if v.friends %}{{v.friends}}{% endif %}</textarea>
|
<textarea id="friends-text" class="form-control rounded" aria-label="With textarea" placeholder="Enter your top friends on the site..." rows="3" name="friends" form="profile-friends" maxlength="1500">{% if v.friends %}{{v.friends}}{% endif %}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
|
|
|
@ -177,7 +177,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if u.friends_html %}
|
{% if u.friends_html %}
|
||||||
<p class="text-muted font-weight-bold">Top 8 friends:</p>
|
<p class="text-muted font-weight-bold">Top friends:</p>
|
||||||
{{u.friends_html | safe}}
|
{{u.friends_html | safe}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if u.friends_html %}
|
{% if u.friends_html %}
|
||||||
<p class="text-muted font-weight-bold mt-3">Top 8 friends:</p>
|
<p class="text-muted font-weight-bold mt-3">Top friends:</p>
|
||||||
{{u.friends_html | safe}}
|
{{u.friends_html | safe}}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue