Skip to content

Commit

Permalink
Resolves #31: Add template for successful submission of webmention.
Browse files Browse the repository at this point in the history
Success message now rendered via template allowing for user customisation.
  • Loading branch information
beatonma committed Jul 1, 2022
1 parent e8ff161 commit 04226fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions mentions/templates/webmention-accepted.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Webmention successful</title>
</head>
<body>
Thank you, your webmention has been accepted
</body>
</html>
4 changes: 2 additions & 2 deletions mentions/views/submit_mentions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.core.exceptions import ValidationError
from django.core.validators import URLValidator
from django.http import HttpResponse, HttpResponseBadRequest
from django.http import HttpResponseBadRequest
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base import View
Expand Down Expand Up @@ -46,7 +46,7 @@ def post(self, request):
return HttpResponseBadRequest()

handle_incoming_webmention(http_post, client_ip)
return HttpResponse("Thank you, your webmention has been accepted.", status=202)
return render(request, "webmention-accepted.html", status=202)


def _get_client_ip(request):
Expand Down

0 comments on commit 04226fc

Please sign in to comment.