Fix "is not" vs "!="
All checks were successful
Build and Publish / build_and_publish (push) Successful in 31s

This commit is contained in:
Nexus 2024-07-11 18:58:38 +01:00
parent 05f39a0a9f
commit 7eee976692
Signed by: nex
GPG key ID: 0FA334385D0B689F
2 changed files with 2 additions and 1 deletions

View file

@ -8,6 +8,7 @@ services:
#- CONTACT_NAME=Your Name Here
#- CONTACT_EMAIL=your@email.example
#- CONTACT_URL=https://your.website.example/contact
#- ALLOW_ANONYMOUS=false # Disable creation for anonymous users
depends_on:
- db
db:

View file

@ -144,7 +144,7 @@ async def create_redirect(
slug_type: str = Form("urlsafe", regex="^(urlsafe|hex|words|uuid)$"),
account: typing.Annotated[db.Account, Depends(has_account)] = None
):
if os.getenv("ALLOW_ANONYMOUS", "true") is not "true":
if os.getenv("ALLOW_ANONYMOUS", "true") != "true":
if account is None:
raise HTTPException(status_code=401, detail="Unauthorised", headers={"WWW-Authenticate": "Basic"})
parsed = urlparse(destination)