limit to only file exists err

This commit is contained in:
samerbam 2023-08-24 23:29:19 -04:00
parent eb7d00c72f
commit 58d9a4229e

View File

@ -72,11 +72,13 @@ def first_run():
with open('.firsttimeruncheck', 'x') as f: with open('.firsttimeruncheck', 'x') as f:
f.write("") f.write("")
return {"status": "First Run"} return {"status": "First Run"}
except Exception as e: except OSError as e:
print(e) print(e)
if e.errno == errno.EEXIST:
return {"status": "Not First Run"} return {"status": "Not First Run"}
@app.get("/api/todos/get") @app.get("/api/todos/get")
def get_todos(date: str = datetime.today().strftime('%Y-%m-%d'), auth_result: str = Security(auth.verify)): def get_todos(date: str = datetime.today().strftime('%Y-%m-%d'), auth_result: str = Security(auth.verify)):
"""A valid access token is required to access this route""" """A valid access token is required to access this route"""