Added check if demo website
This commit is contained in:
parent
f8264ce3ec
commit
336c1cdcc3
11
web/views.py
11
web/views.py
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user