diff --git a/ext.py b/ext.py index 8bf65f8..de45b17 100644 --- a/ext.py +++ b/ext.py @@ -60,6 +60,7 @@ class Order: self.is_artist = True if self.ans('is_artist') != 'No' else False self.is_fursuiter = True if self.ans('is_fursuiter') != 'No' else False self.is_allergic = True if self.ans('is_allergic') != 'No' else False + self.propic_locked = self.ans('propic_locked') self.birth_date = self.ans('birth_date') self.name = self.ans('fursona_name') self.room_id = self.ans('room_id') @@ -120,6 +121,7 @@ class Order: async with httpx.AsyncClient() as client: res = await client.patch(join(base_url, f'orderpositions/{self.position_id}/'), headers=headers, json={'answers': self.answers}) self.pending_update = False + self.time = -1 @dataclass class Quotas: @@ -183,7 +185,7 @@ class OrderManager: self.add_cache(Order(o)) # If a cached order is needed, just get it if available - if code and cached and code in self.cache and time()-self.cache[code].time < 1800: + if code and cached and code in self.cache and time()-self.cache[code].time < 3600: return self.cache[code] # If it's a request, ignore all the other parameters and just get the order of the requestor diff --git a/propic.py b/propic.py index 0802f39..cc62c84 100644 --- a/propic.py +++ b/propic.py @@ -15,6 +15,9 @@ bp = Blueprint("propic", url_prefix="/manage/propic") async def upload_propic(request, order: Order): if not order: raise exceptions.Forbidden("You have been logged out. Please access the link in your E-Mail to login again!") + if order.propic_locked: + raise exceptions.BadRequest("You have been limited from further editing the propic.") + if request.form.get('submit') == 'Delete main image': await order.edit_answer('propic', None) diff --git a/tpl/blocks/badge.html b/tpl/blocks/badge.html index dc5c986..9295103 100644 --- a/tpl/blocks/badge.html +++ b/tpl/blocks/badge.html @@ -2,9 +2,11 @@ Badge Customization {% if not order.ans('propic') %}⚠️{% endif %} {# Badge is always shown #}

Badge

+ {% if order.propic_locked %} +

⚠️ You have been limited from further editing your profile pic.

+ {% endif %} {% if (not order.ans('propic')) or (order.ans('is_fursuiter') != 'No' and not order.ans('propic_fursuiter')) %}

⚠️ One or more badge pictures are missing! This will cause you badge to be empty, so make sure to upload something before the deadline!

-

⚠️ Photos must be suitable for any audience. Any inappropriate picture will be removed by the staff

{% endif %}
@@ -31,7 +33,10 @@
{% endif %} -

Min size: 64x64 - Max Size: 5MB, 2048x2048 - Formats: jpg, png

+

+ Min size: 64x64 - Max Size: 5MB, 2048x2048 - Formats: jpg, png
+ Badge photos must clearly show the fursona/fursuit head.
Memes and low quality images will be removed and may limit your ability to upload pics in the future. +

{% if order.ans('propic') %}