fix bug 748: provide a proper error when user is not valid upon new token
allow authenticate with both project_id and project_name, user_id and username
Change-Id: I463e2aaa469fea8ad656407dd7b48ed5e28aff28
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py
index 7c98a34..9facd8b 100644
--- a/osm_nbi/admin_topics.py
+++ b/osm_nbi/admin_topics.py
@@ -655,11 +655,11 @@
:param db_content: The database content of this item _id
:return: None if ok or raises EngineException with the conflict
"""
- projects = self.auth.get_project_list()
- current_project = [project for project in projects
- if project["name"] in session["project_id"]][0]
+ # projects = self.auth.get_project_list()
+ # current_project = [project for project in projects
+ # if project["name"] in session["project_id"]][0]
- if _id == current_project["_id"]:
+ if _id == session["project_id"]:
raise EngineException("You cannot delete your own project", http_code=HTTPStatus.CONFLICT)
def new(self, rollback, session, indata=None, kwargs=None, headers=None):