def urlcheck(request): url = request.POST.get("long_url", None) if not url: return { "valid": False } status = test_url(get_destination_url(url)) if status["status_current"]: return { "valid": True } return { "valid": False }
def get_destination_url(self): return get_destination_url(self.destination_url)