From a984ae43e5d452df372f922cf0761cbb94d440d2 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Mon, 10 Dec 2018 04:07:01 +0900 Subject: [PATCH] pylint: fix raising-non-exception error django.http.HttpResponseNotFound is not an exception. Django recommends to return it. @rest_utils.ajax can handle it. Change-Id: I26f82da022a2c2725d62cc136c5da8eafc0ac26f --- .pylintrc | 1 - openstack_dashboard/api/rest/keystone.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pylintrc b/.pylintrc index 4bcd2776a9..732deb4f04 100644 --- a/.pylintrc +++ b/.pylintrc @@ -13,7 +13,6 @@ disable= method-hidden, no-member, not-callable, - raising-non-exception, # "W" Warnings for stylistic problems or minor programming issues arguments-differ, attribute-defined-outside-init, diff --git a/openstack_dashboard/api/rest/keystone.py b/openstack_dashboard/api/rest/keystone.py index fe92389640..9c348d780a 100644 --- a/openstack_dashboard/api/rest/keystone.py +++ b/openstack_dashboard/api/rest/keystone.py @@ -135,7 +135,7 @@ class User(generic.View): This method returns HTTP 204 (no content) on success. """ if id == 'current': - raise django.http.HttpResponseNotFound('current') + return django.http.HttpResponseNotFound('current') api.keystone.user_delete(request, id) @rest_utils.ajax(data_required=True) @@ -255,7 +255,7 @@ class Role(generic.View): This method returns HTTP 204 (no content) on success. """ if id == 'default': - raise django.http.HttpResponseNotFound('default') + return django.http.HttpResponseNotFound('default') api.keystone.role_delete(request, id) @rest_utils.ajax(data_required=True) @@ -355,7 +355,7 @@ class Domain(generic.View): This method returns HTTP 204 (no content) on success. """ if id == 'default': - raise django.http.HttpResponseNotFound('default') + return django.http.HttpResponseNotFound('default') api.keystone.domain_delete(request, id) @rest_utils.ajax(data_required=True)