forked from MarseyWorld/MarseyWorld
ping group fixes
parent
ffe728946c
commit
b38f918af6
|
@ -187,8 +187,12 @@ def group_reject(v, group_name, user_id):
|
|||
if not membership:
|
||||
abort(404, "There is no membership to reject!")
|
||||
|
||||
if v.id != group.owner.id and membership.is_mod:
|
||||
abort(403, "Only the group owner can kick mods!")
|
||||
if v.id != membership.user_id: #implies kicking and not leaving
|
||||
if membership.user_id == group.owner.id:
|
||||
abort(403, "You can't kick the group owner!")
|
||||
|
||||
if v.id != group.owner.id and membership.is_mod:
|
||||
abort(403, "Only the group owner can kick mods!")
|
||||
|
||||
if v.id == membership.user_id:
|
||||
msg = f"You have left !{group} successfully!"
|
||||
|
|
|
@ -66,9 +66,11 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="kick-{{membership.user_id}}" {% if name == 'applications' %}class="d-none"{% endif %}>
|
||||
<button type="button" class="btn btn-danger btn-block" data-nonce="{{g.nonce}}" data-onclick="reject_membership(this,'{{group}}','{{membership.user_id}}')">{% if v.id == membership.user_id %}Leave{% else %}Kick{% endif %}</button>
|
||||
</div>
|
||||
{% if v.id == membership.user_id or v.id == group.owner.id or not membership.user.mods_group(group) %}
|
||||
<div id="kick-{{membership.user_id}}" {% if name == 'applications' %}class="d-none"{% endif %}>
|
||||
<button type="button" class="btn btn-danger btn-block" data-nonce="{{g.nonce}}" data-onclick="reject_membership(this,'{{group}}','{{membership.user_id}}')">{% if v.id == membership.user_id %}Leave{% else %}Kick{% endif %}</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div {% if name == 'members' %}class="d-none"{% endif %}>
|
||||
<button type="button" class="btn btn-success btn-block" data-nonce="{{g.nonce}}" data-onclick="approve_membership(this,'{{group}}','{{membership.user_id}}')">Approve</button>
|
||||
|
|
Loading…
Reference in New Issue