diff --git a/files/routes/groups.py b/files/routes/groups.py index 4967f4c52..aea743443 100644 --- a/files/routes/groups.py +++ b/files/routes/groups.py @@ -176,14 +176,15 @@ def group_reject(v:User, group_name, user_id): if not membership: abort(404, "There is no membership to reject!") - if membership.approved_utc: - text = f"@{v.username} (!{group}'s owner) has kicked you from the group!" - msg = f"You have kicked @{membership.user.username} successfully!" + if v.id == membership.user_id: + msg = f"You have left !{group} successfully!" else: - text = f"@{v.username} (!{group}'s owner) has rejected your application!" - msg = f"You have rejected @{membership.user.username} successfully!" - - if v.id != membership.user_id: + if membership.approved_utc: + text = f"@{v.username} (!{group}'s owner) has kicked you from the group!" + msg = f"You have kicked @{membership.user.username} successfully!" + else: + text = f"@{v.username} (!{group}'s owner) has rejected your application!" + msg = f"You have rejected @{membership.user.username} successfully!" send_repeatable_notification(membership.user_id, text) g.db.delete(membership) diff --git a/files/templates/group_memberships.html b/files/templates/group_memberships.html index cd2ab90b5..15f9a5434 100644 --- a/files/templates/group_memberships.html +++ b/files/templates/group_memberships.html @@ -59,7 +59,7 @@ {% if v.id == group.owner.id or v.admin_level >= PERMS['MODS_EVERY_GROUP'] %}