Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
014b883
1
Parent(s):
65d61ae
Update app.py
Browse files
app.py
CHANGED
@@ -20,15 +20,15 @@ def avp():
|
|
20 |
try:
|
21 |
incoming = request.get_json()
|
22 |
print(incoming)
|
23 |
-
result = {}
|
24 |
for key, value in incoming.items():
|
25 |
if value.isdigit():
|
26 |
if int(value) > 0:
|
27 |
-
result[
|
|
|
28 |
else:
|
29 |
-
result[
|
30 |
-
|
31 |
-
result[key] = "0"
|
32 |
response = jsonify(result)
|
33 |
return response
|
34 |
except Exception as e:
|
|
|
20 |
try:
|
21 |
incoming = request.get_json()
|
22 |
print(incoming)
|
23 |
+
result = {"bazis": "0"} # Установка значения по умолчанию
|
24 |
for key, value in incoming.items():
|
25 |
if value.isdigit():
|
26 |
if int(value) > 0:
|
27 |
+
result["bazis"] = str(int(value) - 1)
|
28 |
+
# Если значение больше нуля, устанавливаем его уменьшенное значение - 1
|
29 |
else:
|
30 |
+
result["bazis"] = "0"
|
31 |
+
# Если значение равно нулю, устанавливаем значение "0"
|
|
|
32 |
response = jsonify(result)
|
33 |
return response
|
34 |
except Exception as e:
|