(20241009) 'last decorator' bug-fixed

This commit is contained in:
2024-10-09 10:25:36 +05:30
parent d9117f2a92
commit 23cfebc20d
2 changed files with 9 additions and 8 deletions
+9 -8
View File
@@ -346,9 +346,10 @@ def set_api_version(api_version):
# Done here:
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
print(kwargs["decorator_count"])
return response
return wrapper
@@ -404,7 +405,7 @@ def read_input(
# Done here:
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
return response
@@ -543,7 +544,7 @@ def validate_input(
# Done here:
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
return response
@@ -683,7 +684,7 @@ def log_request_to_mongo(
# Return the response from the wrapped function.
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
return response
@@ -724,7 +725,7 @@ def should_not_be_under_maintenance(attr_name):
# Done here:
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
return response
@@ -771,7 +772,7 @@ def only_whitelisted_ips(attr_name):
# Done here:
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
return response
@@ -879,7 +880,7 @@ def limit_rate(
# Return the response from the function call:
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
return response
@@ -918,7 +919,7 @@ def handle_cancelled_request(cleanup_func = None, cleanup_coro = None):
# Done here:
if (
kwargs["decorator_count"] == 1 and
kwargs["decorator_count"] == 0 and
isinstance(response, ResponseModel)
): response = response.for_quart()
return response