randydev commited on
Commit
efb3aec
1 Parent(s): aaa8cb2

Upload main.py

Browse files
Files changed (1) hide show
  1. main.py +14 -16
main.py CHANGED
@@ -338,28 +338,26 @@ def sibyl_system_ban(
338
  except Exception as e:
339
  return ErrorStatus(status="false", message=f"Internal server error: {str(e)}")
340
 
341
- @app.get("/ryuzaki/sibyl", response_model=SibylSystemResponse, responses={422: {"model": SibylSystemResponse}})
342
  def sibyl_system(
343
  item: SibylSystem,
344
  api_key: None = Depends(validate_api_key)
345
  ):
346
- sibyl_name, reason, is_banned, date_joined, sibyl_user_id = get_sibyl_system_banned(item.user_id)
347
- if sibyl_name and reason and is_banned and date_joined and sibyl_user_id:
348
- return SibylSystemResponse(
349
- sibyl_name=sibyl_name,
350
- reason=reason,
351
- is_banned=is_banned,
352
- date_joined=date_joined,
353
- sibyl_user_id=sibyl_user_id
 
 
 
 
354
  )
355
  else:
356
- return SibylSystemResponse(
357
- sibyl_name="",
358
- reason="",
359
- is_banned=False,
360
- date_joined="",
361
- sibyl_user_id=0
362
- )
363
 
364
  @app.get("/ryuzaki/ai", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
365
  def ryuzaki_ai(
 
338
  except Exception as e:
339
  return ErrorStatus(status="false", message=f"Internal server error: {str(e)}")
340
 
341
+ @app.get("/ryuzaki/sibyl", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
342
  def sibyl_system(
343
  item: SibylSystem,
344
  api_key: None = Depends(validate_api_key)
345
  ):
346
+ sibyl_result = get_sibyl_system_banned(item.user_id)
347
+ if sibyl_result is not None:
348
+ sibyl_name, reason, is_banned, date_joined, sibyl_user_id = sibyl_result
349
+ return SuccessResponse(
350
+ status="True",
351
+ randydev={
352
+ "sibyl_name": sibyl_name,
353
+ "reason": reason,
354
+ "is_banned": is_banned,
355
+ "date_joined": date_joined,
356
+ "sibyl_user_id": sibyl_user_id
357
+ }
358
  )
359
  else:
360
+ return ErrorStatus(status="false", message="Not found user")
 
 
 
 
 
 
361
 
362
  @app.get("/ryuzaki/ai", response_model=SuccessResponse, responses={422: {"model": ErrorStatus}})
363
  def ryuzaki_ai(