delete groups
This commit is contained in:
@@ -272,3 +272,14 @@ def group_edit(gid):
|
|||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
return redirect(url_for("manage.groups"))
|
return redirect(url_for("manage.groups"))
|
||||||
|
|
||||||
|
@bp.route("/group_delete/<gid>")
|
||||||
|
@login_required
|
||||||
|
def group_delete(gid):
|
||||||
|
db = get_db()
|
||||||
|
|
||||||
|
db.execute("DELETE FROM groups WHERE id=(?)",(gid,))
|
||||||
|
db.execute("DELETE FROM group_members WHERE group_id=(?)",(gid,))
|
||||||
|
db.commit()
|
||||||
|
|
||||||
|
return redirect(url_for("manage.groups"))
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="heading">Create new group</div>
|
<div class="heading big">Create new group</div>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<label for="name">Name</label>
|
<label for="name">Name</label>
|
||||||
<input name="name" id="name" required><br>
|
<input name="name" id="name" required><br>
|
||||||
@@ -16,6 +16,8 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="heading big">Edit Groups</div>
|
<div class="heading big">Edit Groups</div>
|
||||||
|
<b>Group privacy settings do not affect members contained within the groups</b><br>
|
||||||
|
Deleting a group does not delete any members who are part of that group
|
||||||
{% for group in groups %}
|
{% for group in groups %}
|
||||||
<form method="post" action="{{url_for('manage.group_edit', gid=group[0])}}">
|
<form method="post" action="{{url_for('manage.group_edit', gid=group[0])}}">
|
||||||
<label for="name">Name</label>
|
<label for="name">Name</label>
|
||||||
@@ -28,7 +30,7 @@
|
|||||||
<label for="private">Private</label><br>
|
<label for="private">Private</label><br>
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
<a class="danger">Delete group</a> - WARNING: this action is permanent and irreversible. this will not delete any members contained within the group.
|
<a href="{{url_for('manage.group_delete', gid=group[0])}}" class="danger">Delete group</a> - WARNING: this action is permanent and irreversible
|
||||||
<hr>
|
<hr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user