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:
parent
3390b2e374
commit
5d9da36bc5
|
@ -12,6 +12,11 @@ def ep_healthcheck():
|
|||
"status": "OK"
|
||||
}
|
||||
|
||||
@app.route("/reset_users_because_postman_is_dumb_like_that")
|
||||
def ep_reset():
|
||||
ldb.reset()
|
||||
return {}
|
||||
|
||||
@app.route("/users", methods = ["GET"])
|
||||
def ep_users_get():
|
||||
return ldb.get_users()
|
||||
|
|
|
@ -6,6 +6,11 @@ class LocalDB:
|
|||
self.categories = {}
|
||||
self.records = {}
|
||||
|
||||
def reset(self):
|
||||
for k, v in list(self.users.items()):
|
||||
if v == "test1":
|
||||
del self.users[k]
|
||||
|
||||
def get_users(self):
|
||||
return self.users
|
||||
|
||||
|
|
Loading…
Reference in New Issue