Skip to content

Commit

Permalink
Enforce POST method for account delete view
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioo committed Jan 19, 2023
1 parent 8e14ac9 commit 7f0573e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modoboa/admin/views/identity.py
Expand Up @@ -11,6 +11,7 @@
from django.utils.translation import ugettext as _, ungettext
from django.views import generic
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_http_methods

from modoboa.core.models import User
from modoboa.lib.exceptions import BadRequest, PermDeniedException
Expand Down Expand Up @@ -185,6 +186,7 @@ def editaccount(request, pk):

@login_required
@permission_required("core.delete_user")
@require_http_methods(["POST"])
def delaccount(request, pk):
User.objects.get(pk=pk).delete()
return render_to_json_response(
Expand Down

0 comments on commit 7f0573e

Please sign in to comment.