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