From 7eee976692a6aa90f13dccd0d6f84cda43dd3023 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 11 Jul 2024 18:58:38 +0100 Subject: [PATCH] Fix "is not" vs "!=" --- docker-compose.yml | 1 + src/main.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2be79f3..59cba6d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/src/main.py b/src/main.py index bd4a390..d7f37fd 100644 --- a/src/main.py +++ b/src/main.py @@ -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)