Spaces:
Sleeping
Sleeping
Commit
·
4b3cb4a
1
Parent(s):
f8a8a2f
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,13 +22,13 @@ def avp():
|
|
| 22 |
print(incoming)
|
| 23 |
result = {}
|
| 24 |
for key, value in incoming.items():
|
| 25 |
-
if
|
| 26 |
-
if value > 0:
|
| 27 |
-
result[key] = value - 1
|
| 28 |
else:
|
| 29 |
-
result[key] = 0
|
| 30 |
else:
|
| 31 |
-
result[key] = 0 # Если значение не является
|
| 32 |
response = jsonify(result)
|
| 33 |
return response
|
| 34 |
except Exception as e:
|
|
|
|
| 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] = "0"
|
| 30 |
else:
|
| 31 |
+
result[key] = "0" # Если значение не является числом, присваиваем "0"
|
| 32 |
response = jsonify(result)
|
| 33 |
return response
|
| 34 |
except Exception as e:
|