From 4938370eea5564f92c00bcfcd31770bfe615f644 Mon Sep 17 00:00:00 2001 From: "pierre.geeraert" Date: Mon, 7 Sep 2026 10:44:14 +0100 Subject: [PATCH] setup the clearkey --- django_code/apps/website_redirection/views.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/django_code/apps/website_redirection/views.py b/django_code/apps/website_redirection/views.py index ec1b57c..be77d40 100644 --- a/django_code/apps/website_redirection/views.py +++ b/django_code/apps/website_redirection/views.py @@ -20,9 +20,10 @@ def redirect(request): def clearkey_process(request): key = request.GET.get('key') - #commenting this for now , need to see if the function is usefull - #r.delete(key) - return 0 + redirectData.objects.update_or_create(key=key,defaults={'url': "None"}) + + text_generated = key+" is set to None" + return HttpResponse(text_generated, content_type="text/plain") def redirect_process(request): key = request.GET.get('key') @@ -42,8 +43,8 @@ def display_key(request,key): def redirect_to_key(request,key): redirect_object = redirectData.objects.filter(key=key) value = str(redirect_object.values('url')[0]['url']) - - if value == None: + + if value == "None": #get the icon url, if it doesn't exist , create it with a default icon icon_url = redirectData.objects.get_or_create(key="icon",defaults={'url':"https://cdn-icons-png.flaticon.com/512/6402/6402576.png"})[0].url