gabcares commited on
Commit
de66f3e
·
verified ·
1 Parent(s): fa6d9f4

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -4
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
- await session.commit()
193
- await session.refresh(instance)
 
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