rename /!group/members to /!group

master
Aevann 2023-02-26 00:06:43 +02:00
parent 878ba5b80b
commit 3cec0297cf
3 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ def join_group(v:User, group_name):
if not existing: if not existing:
join = GroupMembership(user_id=v.id, group_name=group_name) join = GroupMembership(user_id=v.id, group_name=group_name)
g.db.add(join) g.db.add(join)
send_notification(group.owner.id, f"@{v.username} has applied to join !{group}. You can approve or reject the application [here](/!{group}/members).") send_notification(group.owner.id, f"@{v.username} has applied to join !{group}. You can approve or reject the application [here](/!{group}).")
return {"message": f"Application submitted to !{group}'s owner (@{group.owner.username}) successfully!"} return {"message": f"Application submitted to !{group}'s owner (@{group.owner.username}) successfully!"}
@ -88,7 +88,7 @@ def leave_group(v:User, group_name):
return {"message": ''} return {"message": ''}
@app.get("/!<group_name>/members") @app.get("/!<group_name>")
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) @limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
@auth_required @auth_required
def memberships(v:User, group_name): def memberships(v:User, group_name):

View File

@ -1,5 +1,5 @@
{% extends "default.html" %} {% extends "default.html" %}
{% block pagetitle %}!{{group}} Members{% endblock %} {% block pagetitle %}!{{group}}{% endblock %}
{% block content %} {% block content %}
<br> <br>

View File

@ -21,7 +21,7 @@
<td>{{loop.index}}</td> <td>{{loop.index}}</td>
<td>{{group.name}}</td> <td>{{group.name}}</td>
<td class="unbreakable"> <td class="unbreakable">
<a href="/!{{group}}/members">{{group.member_ids | length}}</a> <a href="/!{{group}}">{{group.member_ids | length}}</a>
{% if v.id != group.owner.id %} {% if v.id != group.owner.id %}
<button id="leave-{{group}}" type="button" class="ml-3 ml-md-5 btn btn-primary {% if v.id not in group.membership_user_ids %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/!{{group}}/leave','leave-{{group}}','apply-{{group}}','d-none')"> <button id="leave-{{group}}" type="button" class="ml-3 ml-md-5 btn btn-primary {% if v.id not in group.membership_user_ids %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/!{{group}}/leave','leave-{{group}}','apply-{{group}}','d-none')">
{%- if v.id in group.member_ids -%} {%- if v.id in group.member_ids -%}