From 55d48e7d9a12c290048fa3214bcf16e6ff0d22e7 Mon Sep 17 00:00:00 2001 From: lombardofr Date: Fri, 21 Jun 2019 19:35:14 +0200 Subject: [PATCH] improved role management Change-Id: Iaf87385269b2195ba964a951939deca6be938013 Signed-off-by: lombardofr --- authosm/views.py | 3 +- instancehandler/views.py | 2 +- projecthandler/osm_model.py | 9 +-- rolehandler/templates/modal/role_create.html | 17 ++++- rolehandler/templates/modal/role_edit.html | 22 +++++- rolehandler/templates/role_list.html | 12 ++-- rolehandler/urls.py | 5 +- rolehandler/views.py | 66 ++++++++++++++--- static/src/rolehandler/role_list.js | 76 +++++++++++++++----- vimhandler/views.py | 1 - 10 files changed, 164 insertions(+), 49 deletions(-) diff --git a/authosm/views.py b/authosm/views.py index f82f4dd..2cfe043 100644 --- a/authosm/views.py +++ b/authosm/views.py @@ -26,8 +26,7 @@ def user_login(request): error_message = '' if request.POST: - print request.POST.get('username') - print request.POST.get('password') + next_page = request.POST.get('next') next_page = urllib.unquote(next_page).decode('iso-8859-2') try: diff --git a/instancehandler/views.py b/instancehandler/views.py index edf0da1..cf88f99 100644 --- a/instancehandler/views.py +++ b/instancehandler/views.py @@ -167,7 +167,7 @@ def create(request, type=None): except Exception as e: return __response_handler(request, {'status': 400, 'code': 'BAD_REQUEST', 'detail': e.message} , url=None, status=400) result = client.ns_create(user.get_token(), ns_data) - print result + if result['error']: return __response_handler(request, result['data'], url=None, status=result['data']['status'] if 'status' in result['data'] else 500) diff --git a/projecthandler/osm_model.py b/projecthandler/osm_model.py index 1775797..718c08d 100644 --- a/projecthandler/osm_model.py +++ b/projecthandler/osm_model.py @@ -56,11 +56,10 @@ class OsmProject(object): client = Client() if type_descriptor == 'nsd': result = client.nsd_get(descriptor_id) - print result + elif type_descriptor == 'vnfd': result = client.vnfd_get(descriptor_id) - print result except Exception as e: log.exception(e) result = {} @@ -175,11 +174,11 @@ class OsmProject(object): else: return False result = yaml.load(result) - print result + except Exception as e: log.exception(e) result = False - print result + return result def get_add_element(self, request): @@ -215,7 +214,6 @@ class OsmProject(object): except Exception as e: log.exception(e) result = False - print result return result @staticmethod @@ -232,5 +230,4 @@ class OsmProject(object): except Exception as e: log.exception(e) result = False - print result return result \ No newline at end of file diff --git a/rolehandler/templates/modal/role_create.html b/rolehandler/templates/modal/role_create.html index 58d68ca..d8282a7 100644 --- a/rolehandler/templates/modal/role_create.html +++ b/rolehandler/templates/modal/role_create.html @@ -17,9 +17,22 @@ + + +
+
+
+ +
+
+
+
+ +
+ +
- -