Remove is_nofollow from backend.

remotes/1693176582716663532/tmp_refs/heads/watchparty
Snakes 2022-11-09 04:59:50 -05:00
parent 4afa60dc81
commit e0f43c3668
Signed by: Snakes
GPG Key ID: E745A82778055C7E
5 changed files with 6 additions and 11 deletions

View File

@ -117,7 +117,6 @@ class User(Base):
defaultsortingcomments = Column(String, default="hot")
defaultsorting = Column(String, default="hot")
defaulttime = Column(String, default=DEFAULT_TIME_FILTER)
is_nofollow = Column(Boolean, default=False)
custom_filter_list = Column(String)
discord_id = Column(String)
original_username = Column(String)

View File

@ -120,7 +120,6 @@ def settings_personal_post(v):
updated = updated or update_flag("sigs_disabled", "sigs_disabled")
updated = updated or update_flag("over_18", "over_18")
updated = updated or update_flag("is_private", "private")
updated = updated or update_flag("is_nofollow", "nofollow")
if not updated and request.values.get("spider", v.spider) != v.spider and v.spider <= 1:
updated = True

View File

@ -841,9 +841,6 @@ def follow_user(username, v):
if target.id==v.id:
abort(400, "You can't follow yourself!")
if target.is_nofollow:
abort(403, "This user has disallowed other users from following them!")
if g.db.query(Follow).filter_by(user_id=v.id, target_id=target.id).one_or_none():
return {"message": f"@{target.username} has been followed!"}

View File

@ -17,7 +17,7 @@
<a class="card-title text-break stretched-link mb-0" href="{{u.url}}"><h5>@{{u.username}}</h5></a>
{% if v %}
{% if v.id!=u.id and not u.is_private and not u.is_nofollow %}
{% if v.id != u.id and not u.is_private %}
<div id="button-sub-{{u.id}}" style="z-index: 2" class="{% if u.has_follower(v) %}d-none{% endif %}"><button type="button" class="btn btn-primary" onclick="postToastSwitch(this,'/follow/{{u.username}}','button-sub-{{u.id}}','button-unsub-{{u.id}}','d-none')">Follow</button></div>
<div id="button-unsub-{{u.id}}" style="z-index: 2" class="{% if not u.has_follower(v) %} d-none{% endif %}"><button type="button" class="btn btn-secondary" onclick="postToastSwitch(this,'/unfollow/{{u.username}}','button-sub-{{u.id}}','button-unsub-{{u.id}}','d-none')">Unfollow</button></div>

View File

@ -13,7 +13,7 @@
<meta property="og:article:author" content="@{{u.username}}">
<meta property="article:section" content="{{u.username}}'s profile - {{SITE_NAME}}">
<meta property="article:published_time" content="{{u.created_date}}">
<meta property="og:description" name="description" content="{{u.coins}} coins - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers - {% endif %}{% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments{% endif %}{% if u.bio %} - {{u.bio}}{% endif %}">
<meta property="og:description" name="description" content="{{u.coins}} coins - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private %}{{u.stored_subscriber_count}} Followers - {% endif %}{% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments{% endif %}{% if u.bio %} - {{u.bio}}{% endif %}">
<meta property="og:author" name="author" content="@{{u.username}}">
<meta property="og:title" content="{{u.username}}">
<meta property="og:image" content="{{u.banner_url}}">
@ -24,7 +24,7 @@
<meta name="twitter:site" content="{{SITE_FULL}}">
<meta name="twitter:title" content="{{u.username}}'s profile - {{SITE_NAME}}">
<meta name="twitter:creator" content="@{{u.username}}">
<meta name="twitter:description" content="{{u.coins}} coins - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers -{% endif %} {% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments{% endif %}{% if u.bio %} - {{u.bio}}{% endif %}">
<meta name="twitter:description" content="{{u.coins}} coins - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private %}{{u.stored_subscriber_count}} Followers -{% endif %} {% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments{% endif %}{% if u.bio %} - {{u.bio}}{% endif %}">
<meta name="twitter:image" content="{{u.banner_url}}">
<meta name="twitter:url" content="{{u.url}}">
{% endblock %}
@ -166,7 +166,7 @@
<div class="actionbtns mb-3">
<button type="button" id="button-unsub" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" onclick="postToastSwitch(this,'/unfollow/{{u.username}}','button-unsub','button-sub','d-none')">Unfollow</button>
<button type="button" id="button-sub" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" onclick="postToastSwitch(this,'/follow/{{u.username}}','button-unsub','button-sub','d-none')">Follow</button>
<button type="button" id="button-sub" class="btn btn-primary {% if is_following or u.is_blocked %}d-none{% endif %}" onclick="postToastSwitch(this,'/follow/{{u.username}}','button-unsub','button-sub','d-none')">Follow</button>
<button type="button" class="btn btn-primary" onclick="toggleElement('message', 'input-message')">Message</button>
{% if FEATURES['USERS_SUICIDE'] -%}
@ -309,7 +309,7 @@
<i class="fas fa-broom text-admin align-middle ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin"></i>
</span>
{% endif %}
{% if v and v.id != u.id and v.has_follower(u) and not v.is_nofollow %}
{% if v and v.id != u.id and v.has_follower(u) %}
<span class="followsyou badge badge-secondary text-small align-middle mx-1" id="profile-mobile--follows-you">Follows you</span>
{% endif %}
@ -417,7 +417,7 @@
{% if v and v.id != u.id %}
<button type="button" id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" onclick="postToastSwitch(this,'/unfollow/{{u.username}}','button-unsub2','button-sub2','d-none')">Unfollow</button>
<button type="button" id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" onclick="postToastSwitch(this,'/follow/{{u.username}}','button-unsub2','button-sub2','d-none')">Follow</button>
<button type="button" id="button-sub2" class="btn btn-primary {% if is_following or u.is_blocked %}d-none{% endif %}" onclick="postToastSwitch(this,'/follow/{{u.username}}','button-unsub2','button-sub2','d-none')">Follow</button>
<button type="button" class="btn btn-primary" onclick="toggleElement('message-mobile', 'input-message-mobile')">Message</button>
{% if FEATURES['USERS_SUICIDE'] -%}