forked from MarseyWorld/MarseyWorld
remove duplicated code
parent
52907b4a2e
commit
7cd1b2a83f
|
@ -363,13 +363,7 @@ def get_profile_picture(identifier:Union[int, str]) -> str:
|
|||
return x.profile_url if x else 'not_found'
|
||||
|
||||
def get_error():
|
||||
if request.referrer and request.referrer.split('?')[0] == request.base_url:
|
||||
return request.values.get("error")
|
||||
else:
|
||||
return None
|
||||
return request.values.get("error")
|
||||
|
||||
def get_msg():
|
||||
if request.referrer and request.referrer.split('?')[0] == request.base_url:
|
||||
return request.values.get("msg")
|
||||
else:
|
||||
return None
|
||||
return request.values.get("msg")
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
{% 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>
|
||||
|
@ -192,4 +193,5 @@
|
|||
<span><i class="far fa-times"></i></span>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
|
Loading…
Reference in New Issue