add workaround for postman flow

Add endpoint specifically designed to make sure postman flow will
execute correctly on any run regardless of what previous changes have
been done to the server database.
This commit is contained in:
ІО-23 Шмуляр Олег 2024-10-28 17:27:34 +02:00
parent 3390b2e374
commit 5d9da36bc5
Signed by: hasslesstech
GPG Key ID: 09745A46126DDD4C
2 changed files with 10 additions and 0 deletions

View File

@ -12,6 +12,11 @@ def ep_healthcheck():
"status": "OK" "status": "OK"
} }
@app.route("/reset_users_because_postman_is_dumb_like_that")
def ep_reset():
ldb.reset()
return {}
@app.route("/users", methods = ["GET"]) @app.route("/users", methods = ["GET"])
def ep_users_get(): def ep_users_get():
return ldb.get_users() return ldb.get_users()

View File

@ -6,6 +6,11 @@ class LocalDB:
self.categories = {} self.categories = {}
self.records = {} self.records = {}
def reset(self):
for k, v in list(self.users.items()):
if v == "test1":
del self.users[k]
def get_users(self): def get_users(self):
return self.users return self.users