diff --git a/app/auth/views.py b/app/auth/views.py index d3535ac2..69d3570f 100644 --- a/app/auth/views.py +++ b/app/auth/views.py @@ -160,3 +160,13 @@ def edit_profile(): change_profile_form=change_profile_form, title='Edit Profile' ) + + +@auth.route('/edit_profile/delete_self/', methods=['GET', 'POST']) +@login_required +def delete_self(user_id): + selected_user = User.query.filter_by(id=user_id).first() + db.session.delete(selected_user) + db.session.commit() + flash('Your account has been deleted!') + return redirect(url_for('main.index')) diff --git a/app/templates/admin/admin_user_page.html.j2 b/app/templates/admin/admin_user_page.html.j2 index 35246937..ab4772f1 100644 --- a/app/templates/admin/admin_user_page.html.j2 +++ b/app/templates/admin/admin_user_page.html.j2 @@ -70,7 +70,7 @@
Administration actions + Modal Trigger--> deleteDelete User
+
+

Delete Account

+

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,

+
+
+
+
+ +
+ + + +
+
{% endblock %}