Added check if demo website

This commit is contained in:
Amazed 2018-10-29 22:32:54 +01:00
parent f8264ce3ec
commit 336c1cdcc3

View File

@ -111,10 +111,13 @@ def feeds(request):
def feed_delete(request, id): def feed_delete(request, id):
try: try:
# demo website: disable deleting feeds
if not request.get_host() == "hrss.hipstercat.fr:443":
Feed.objects.get(pk=id).delete() Feed.objects.get(pk=id).delete()
except Exception as e: return redirect("/feeds")
pass else:
finally: return HttpResponse("Deleting is disabled on demo website.", status=403)
except ObjectDoesNotExist:
return redirect("/feeds") return redirect("/feeds")
def rss(request, uurl): def rss(request, uurl):