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:
Feed.objects.get(pk=id).delete() # demo website: disable deleting feeds
except Exception as e: if not request.get_host() == "hrss.hipstercat.fr:443":
pass Feed.objects.get(pk=id).delete()
finally: return redirect("/feeds")
else:
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):