Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -193,8 +193,7 @@ async def sms_posts(instance: ResultItem, idx: str = None, action: str = "add")
|
|
| 193 |
await session.delete(existing) # Asynchronous
|
| 194 |
await session.commit()
|
| 195 |
else: # update
|
| 196 |
-
existing.update(instance)
|
| 197 |
-
session.add(existing) # Not asynchronous
|
| 198 |
await session.commit()
|
| 199 |
await session.refresh(instance)
|
| 200 |
result = instance
|
|
|
|
| 193 |
await session.delete(existing) # Asynchronous
|
| 194 |
await session.commit()
|
| 195 |
else: # update
|
| 196 |
+
vars(existing).update(vars(instance))
|
|
|
|
| 197 |
await session.commit()
|
| 198 |
await session.refresh(instance)
|
| 199 |
result = instance
|