diff --git a/app/__init__.py b/app/__init__.py index 9f34e3f..ce226be 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -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() diff --git a/app/local_db.py b/app/local_db.py index 02b6206..ddb0b9b 100644 --- a/app/local_db.py +++ b/app/local_db.py @@ -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