allow emoji update on WPD but only for emojis submitted on WPD

pull/216/head
Aevann 2023-11-01 01:57:18 +03:00
parent 20b09b890b
commit 204aabb777
3 changed files with 9 additions and 6 deletions

View File

@ -74,6 +74,11 @@ if SITE == 'staging.rdrama.net':
SITE_IMAGES = 'i.rdrama.net'
SITE_FULL_IMAGES = f'https://{SITE_IMAGES}'
if SITE == 'rdrama.net':
OTHER_SITE_NAME = 'WPD'
else:
OTHER_SITE_NAME = 'rDrama'
LOGGED_IN_CACHE_KEY = "loggedin"
LOGGED_OUT_CACHE_KEY = "loggedout"
@ -699,7 +704,6 @@ elif SITE == 'watchpeopledie.tv':
PERMS['POST_COMMENT_EDITING'] = 3
PERMS['MODS_EVERY_HOLE'] = 3
PERMS['IS_PERMA_PROGSTACKED'] = 4
PERMS['UPDATE_ASSETS'] = 99
HOLE_BANNER_LIMIT = 69420

View File

@ -494,6 +494,9 @@ def update_emoji(v):
if not existing:
abort(400, "An emoji with this name doesn't exist!")
if SITE in {'rdrama.net', 'watchpeopledie.tv'} and existing.author_id == 2:
abort(403, f"This emoji was submitted through {OTHER_SITE_NAME}, so you can only update it there!")
updated = False
if new_name and existing.name != new_name:

View File

@ -43,11 +43,7 @@
<td>{{emoji.count}}</td>
<td>
{% if emoji.author_id == 2 %}
{% if SITE == 'rdrama.net' %}
a WPD user
{% else %}
an rDrama user
{% endif %}
an {{OTHER_SITE_NAME}} user
{% else %}
{% set user = emoji.user %}
{% include "user_in_table.html" %}