Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Add site=None check #3

Closed
berrysauce opened this issue Oct 15, 2021 · 0 comments
Closed

Add site=None check #3

berrysauce opened this issue Oct 15, 2021 · 0 comments

Comments

@berrysauce
Copy link
Owner

# add site key to widget code
site = sitesdb.get(key)
if site is False:
    raise HTTPException(status_code=404, detail="Site key not found")

# vvv ERROR APPEARED HERE vvv
if site["locked"] is True:
    raise HTTPException(status_code=401, detail="This account was locked. Contact support for further details.")
    
with open("tools/widget.js", "r") as f:
    widget = str(f.read())
    widget = widget.replace("[webkey]", key)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant