misc: pylint fix no-else-raise (#52222)

This commit is contained in:
Lauréline Guérin 2021-03-22 10:59:34 +01:00
parent daf108ffd5
commit f2a3f4c300
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
4 changed files with 5 additions and 9 deletions

View File

@ -1156,8 +1156,7 @@ class FormPage(Directory):
if not user.is_admin and not self.formdef.is_of_concern_for_user(user):
if session.user:
raise errors.AccessForbiddenError()
else:
raise errors.AccessUnauthorizedError()
raise errors.AccessUnauthorizedError()
def get_custom_views(self, criterias=None):
for view in get_publisher().custom_view_class.select(clause=criterias):

View File

@ -682,7 +682,7 @@ class FormData(StorableObject):
def get_role_translation(self, role_name):
if role_name == '_submitter':
raise Exception('_submitter is not a valid role')
elif str(role_name).startswith('_'):
if str(role_name).startswith('_'):
role_id = None
if self.workflow_roles:
role_id = self.workflow_roles.get(role_name)
@ -691,8 +691,7 @@ class FormData(StorableObject):
if role_id is None:
return role_id
return str(role_id)
else:
return str(role_name)
return str(role_name)
def get_handling_role_id(self):
# TODO: look at current status and return the role(s) actually

View File

@ -472,8 +472,7 @@ class QommonPublisher(Publisher):
if not os.path.exists(self.app_dir):
if self.missing_appdir_redirect:
raise ImmediateRedirectException(self.missing_appdir_redirect)
else:
raise Http404()
raise Http404()
try:
os.mkdir(self.form_tokens_dir)

View File

@ -521,8 +521,7 @@ class Template:
from . import _
raise TemplateError(_('failure to render Django template: %s'), e)
else:
return self.value
return self.value
rendered = str(rendered)
if context.get('allow_complex'):
return rendered