diff --git a/horilla/decorators.py b/horilla/decorators.py index 30dd1cf40..5a7e80f5b 100755 --- a/horilla/decorators.py +++ b/horilla/decorators.py @@ -243,7 +243,10 @@ def login_required(view_func): request.session["title"] = "Dashboard".upper() login_url = reverse("login") - query_string = urlencode(request.GET) + try: + query_string = urlencode(request.GET) + except: + query_string = None redirect_url = f"{login_url}?next={request.path}" if query_string: redirect_url += f"&{query_string}" diff --git a/horilla_api/api_views/attendance/views.py b/horilla_api/api_views/attendance/views.py index de3460e92..7005243b7 100644 --- a/horilla_api/api_views/attendance/views.py +++ b/horilla_api/api_views/attendance/views.py @@ -157,6 +157,7 @@ class ClockOutAPIView(APIView): except: pass if request.user.employee_get.check_online(): + print("----------------") current_date = date.today() current_time = datetime.now().time() current_datetime = datetime.now() @@ -174,7 +175,7 @@ class ClockOutAPIView(APIView): except Exception as error: logger.error("Got an error in clock_out", error) - return Response({"message": "Clocked-Out"}, status=200) + # return Response({"message": "Clocked-Out"}, status=200) return Response({"message": "Already clocked-out"}, status=400)