diff --git a/website/views.py b/website/views.py index 8061f2cdd..fc9fcb96e 100644 --- a/website/views.py +++ b/website/views.py @@ -556,6 +556,18 @@ def get_initial(self): def post(self, request, *args, **kwargs): + # resolve domain + url = request.POST.get("url").replace("www.","https://") + try: + response = requests.get(url,timeout=2) + if response.status_code == 200: + print('Web site exists') + else: + raise Exception + except: + messages.error(request,"Domain does not exist") + return HttpResponseRedirect("/issue/") + if len(request.FILES['screenshot'].name)>99: filename = request.FILES['screenshot'].name extension = filename.split(".")[-1]