Ufoptg commited on
Commit
ac64656
1 Parent(s): 1f5e3d5

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +13 -7
main.py CHANGED
@@ -129,21 +129,27 @@ def blacklist_words():
129
  except Exception as e:
130
  return {"status": "false", "message": f"Internal server error: {str(e)}"}
131
 
132
- @app.delete("/UFoP/bandel")
133
  def sibyl_system_delete(
134
- user_id: int = Query(..., description="User ID in query parameter only developer"),
135
  api_key: None = Depends(validate_api_key_only_devs)
136
  ):
137
  try:
138
- _, _, _, _, sibyl_user_id = db.get_sibyl_system_banned(user_id)
139
 
140
  if sibyl_user_id:
141
- db.remove_sibyl_system_banned(user_id)
142
- return {"status": "true", "message": f"Successfully removed {user_id} from the Sibyl ban list."}
 
 
 
143
  else:
144
- return {"status": "false", "message": "Not found user"}
 
 
 
145
  except Exception as e:
146
- return {"status": "false", "message": f"Internal server error: {str(e)}"}
147
 
148
  @app.post("/UFoP/banner")
149
  def sibyl_system_ban(
 
129
  except Exception as e:
130
  return {"status": "false", "message": f"Internal server error: {str(e)}"}
131
 
132
+ @app.delete("/UFoP/bandel", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}}))
133
  def sibyl_system_delete(
134
+ item: SibylSystemDel,
135
  api_key: None = Depends(validate_api_key_only_devs)
136
  ):
137
  try:
138
+ _, _, _, _, sibyl_user_id = db.get_sibyl_system_banned(item.user_id)
139
 
140
  if sibyl_user_id:
141
+ db.remove_sibyl_system_banned(item.user_id)
142
+ return SuccessResponse(
143
+ status="True",
144
+ randydev={"message": f"Successfully removed {item.user_id} from the Sibyl ban list"}
145
+ )
146
  else:
147
+ return SuccessResponse(
148
+ status="False",
149
+ randydev={"message": "Not Found UserID"}
150
+ )
151
  except Exception as e:
152
+ return ErrorStatus(status="false", message=f"Internal server error: {str(e)}")
153
 
154
  @app.post("/UFoP/banner")
155
  def sibyl_system_ban(