Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
7b0bd1e
1
Parent(s):
014b883
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 |
-
# Если значение больше нуля, устанавливаем его уменьшенное значение - 1
|
29 |
else:
|
30 |
-
result[
|
31 |
-
|
|
|
32 |
response = jsonify(result)
|
33 |
return response
|
34 |
except Exception as e:
|
|
|
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[key] = str(int(value) - 1)
|
|
|
28 |
else:
|
29 |
+
result[key] = value
|
30 |
+
else:
|
31 |
+
result[key] = value
|
32 |
response = jsonify(result)
|
33 |
return response
|
34 |
except Exception as e:
|