diff --git a/webmention/urls.py b/webmention/urls.py index 9af094e..bbe1eee 100644 --- a/webmention/urls.py +++ b/webmention/urls.py @@ -4,5 +4,5 @@ from . import views app_name = 'webmention' urlpatterns = ( url('^$', views.accept, name='accept'), - url('^s/(?P\d+)$', views.status, name='status') + url('^s/(?P\d+)$', views.status, name='status') ) diff --git a/webmention/views.py b/webmention/views.py index 80c15cd..9d02e98 100644 --- a/webmention/views.py +++ b/webmention/views.py @@ -54,15 +54,14 @@ def accept(request): mention.entry = entry mention.state = State.PENDING mention.save() - status = reverse('webmention:status', kwargs={'id': mention.id}) + status_url = reverse('webmention:status', kwargs={'id': mention.id}) res = HttpResponse(status=201) - res['Location'] = urljoin(origin, status) + res['Location'] = urljoin(origin, status_url) return res -@csrf_exempt @require_GET -def status(request, id): - mention = get_object_or_404(Webmention.objects, pk=id) +def status(request, mention_id): + mention = get_object_or_404(Webmention.objects, pk=mention_id) return HttpResponse(mention.get_state_display())