Skip to content

Commit

Permalink
Merge pull request #5025 from rtfd/humitos/wipe/remove-csrf-exempt
Browse files Browse the repository at this point in the history
Make wipe view not CSRF exempt
  • Loading branch information
humitos authored Dec 21, 2018
2 parents 62e2d98 + a0477e6 commit 5386e84
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions readthedocs/core/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from django.conf import settings
from django.http import HttpResponseRedirect, Http404, JsonResponse
from django.shortcuts import render, get_object_or_404, redirect
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import TemplateView

from readthedocs.builds.models import Version
Expand Down Expand Up @@ -72,7 +71,6 @@ def random_page(request, project_slug=None): # pylint: disable=unused-argument
return HttpResponseRedirect(url)


@csrf_exempt
def wipe_version(request, project_slug, version_slug):
version = get_object_or_404(
Version,
Expand Down
1 change: 1 addition & 0 deletions readthedocs/templates/wipe_version.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ <h3>
{% endblocktrans %}

<form method="post" action="#">
{% csrf_token %}
<input type="submit" value="{% trans 'Wipe' %} {{ version.slug }}">
</form>
{% endif %}
Expand Down

0 comments on commit 5386e84

Please sign in to comment.