Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -185,12 +185,12 @@ async def sms_posts(instance: ResultItem, idx: str = None, action: str = "add")
|
|
185 |
try:
|
186 |
if checker:
|
187 |
if action == "delete":
|
188 |
-
session.delete(instance)
|
189 |
-
await session.commit()
|
190 |
else: # add or update use add
|
191 |
session.add(instance) # Not asynchronous
|
192 |
-
|
193 |
-
|
|
|
194 |
except Exception as e:
|
195 |
code = 0
|
196 |
error = e
|
|
|
185 |
try:
|
186 |
if checker:
|
187 |
if action == "delete":
|
188 |
+
session.delete(instance)
|
|
|
189 |
else: # add or update use add
|
190 |
session.add(instance) # Not asynchronous
|
191 |
+
|
192 |
+
await session.commit()
|
193 |
+
await session.refresh(instance)
|
194 |
except Exception as e:
|
195 |
code = 0
|
196 |
error = e
|