mirror of
https://github.com/Starlio-app/Starlio-web.git
synced 2024-12-24 17:33:45 +03:00
change condition statuscode
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Has been cancelled
Some checks failed
Create and publish a Docker image / build-and-push-image (push) Has been cancelled
This commit is contained in:
parent
c3918c3d35
commit
c801396953
1 changed files with 4 additions and 5 deletions
|
@ -16,9 +16,8 @@ async def today_wallpaper(request: Request):
|
|||
date = datetime.today().strftime('%Y-%m-%d')
|
||||
res = requests.get(f'https://api.starlio.space/last')
|
||||
|
||||
if not HTTPStatus(res.status_code).is_redirection or \
|
||||
not HTTPStatus(res.status_code).is_success:
|
||||
|
||||
if HTTPStatus(res.status_code).is_server_error or \
|
||||
HTTPStatus(res.status_code).is_client_error:
|
||||
return FileResponse('./src/web/html/error/404.html')
|
||||
|
||||
return RedirectResponse(f'/wallpaper/{date}')
|
||||
|
@ -28,8 +27,8 @@ async def today_wallpaper(request: Request):
|
|||
async def wallpaper(request: Request, day):
|
||||
res = requests.get(f'https://api.starlio.space/wallpaper/{day}')
|
||||
|
||||
if not HTTPStatus(res.status_code).is_redirection or \
|
||||
not HTTPStatus(res.status_code).is_success:
|
||||
if HTTPStatus(res.status_code).is_server_error or \
|
||||
HTTPStatus(res.status_code).is_client_error:
|
||||
return FileResponse('./src/web/html/error/404.html')
|
||||
|
||||
return template.TemplateResponse(
|
||||
|
|
Loading…
Add table
Reference in a new issue