misc: pylint fix no-else-raise (#52222)
This commit is contained in:
parent
daf108ffd5
commit
f2a3f4c300
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue