Spaces:
Runtime error
Runtime error
Commit
·
0a20852
1
Parent(s):
e91a221
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,10 +26,13 @@ def avp():
|
|
| 26 |
print(incoming)
|
| 27 |
result = {}
|
| 28 |
for key, value in incoming.items():
|
| 29 |
-
if
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
| 31 |
else:
|
| 32 |
-
result[key] = "0"
|
| 33 |
response = jsonify(result)
|
| 34 |
return response
|
| 35 |
except Exception as e:
|
|
|
|
| 26 |
print(incoming)
|
| 27 |
result = {}
|
| 28 |
for key, value in incoming.items():
|
| 29 |
+
if isinstance(value, int):
|
| 30 |
+
if value > 0:
|
| 31 |
+
result[key] = str(value - 1)
|
| 32 |
+
else:
|
| 33 |
+
result[key] = "0"
|
| 34 |
else:
|
| 35 |
+
result[key] = "0" # Если значение не является целым числом, присваиваем "0"
|
| 36 |
response = jsonify(result)
|
| 37 |
return response
|
| 38 |
except Exception as e:
|