fix manually applied errors not working

master
Aevann 2023-07-14 15:07:21 +03:00
parent 6c2ba09e7f
commit 39f1bbf0d7
2 changed files with 9 additions and 5 deletions

View File

@ -370,10 +370,16 @@ def get_profile_picture(identifier:Union[int, str]) -> str:
return x.profile_url if x else 'not_found'
def get_error():
return request.values.get("error")
if request.referrer and request.referrer.split('?')[0] == request.base_url:
return request.values.get("error")
else:
return None
def get_msg():
return request.values.get("msg")
if request.referrer and request.referrer.split('?')[0] == request.base_url:
return request.values.get("msg")
else:
return None
def get_page():
try: return max(int(request.values.get("page", 1)), 1)

View File

@ -190,7 +190,6 @@
{% endmacro %}
{% macro alert(msg, error=false) %}
{% if request.referrer and request.referrer.split('?')[0] == request.base_url %}
<div class="alert {% if error %}alert-danger{% else %}alert-success{% endif %} alert-dismissible fade show mb-3 mt-4">
<i class="fas {% if error %}fa-exclamation-circle{% else %}fa-check-circle{% endif %} my-auto"></i>
<span>{{msg}}</span>
@ -198,7 +197,6 @@
<span><i class="far fa-times"></i></span>
</button>
</div>
{% endif %}
{% endmacro %}
{% macro reports(i, kind) %}
@ -338,4 +336,4 @@
<h5>Users Online</h5>
<div id="online" class="mt-3"></div>
</div>
{% endmacro %}
{% endmacro %}