Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make wipe view not CSRF exempt #5025

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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