fix: fix 'no-else-return' for pylint
This commit is contained in:
parent
6ac1cacdb3
commit
e845c66d86
4 changed files with 16 additions and 16 deletions
|
@ -12,6 +12,7 @@ enable=anomalous-backslash-in-string,
|
|||
empty-docstring,
|
||||
inconsistent-return-statements,
|
||||
invalid-name,
|
||||
no-else-return,
|
||||
redefined-argument-from-local,
|
||||
too-few-public-methods,
|
||||
trailing-whitespace,
|
||||
|
|
|
@ -88,19 +88,19 @@ class UUID(sa.types.TypeDecorator):
|
|||
""" """
|
||||
if dialect.name == "postgresql":
|
||||
return dialect.type_descriptor(PGUUID())
|
||||
else:
|
||||
return dialect.type_descriptor(sa.CHAR(32))
|
||||
|
||||
def process_bind_param(self, value, dialect): # pylint: disable=empty-docstring
|
||||
""" """
|
||||
if value is None:
|
||||
return value
|
||||
elif dialect.name == "postgresql":
|
||||
|
||||
if dialect.name == "postgresql":
|
||||
return str(value)
|
||||
else:
|
||||
|
||||
if not isinstance(value, _uuid.UUID):
|
||||
return "%.32x" % _uuid.UUID(value).int
|
||||
else:
|
||||
|
||||
# hexstring
|
||||
return "%.32x" % value.int
|
||||
|
||||
|
@ -108,7 +108,6 @@ class UUID(sa.types.TypeDecorator):
|
|||
""" """
|
||||
if value is None:
|
||||
return value
|
||||
else:
|
||||
if not isinstance(value, _uuid.UUID):
|
||||
value = _uuid.UUID(value)
|
||||
return value
|
||||
|
|
|
@ -558,9 +558,9 @@ class InstallHandler(GenericHandler):
|
|||
if is_bool:
|
||||
if text == '':
|
||||
return default
|
||||
elif text.upper() == 'Y':
|
||||
if text.upper() == 'Y':
|
||||
return True
|
||||
elif text.upper() == 'N':
|
||||
if text.upper() == 'N':
|
||||
return False
|
||||
self.rprint("\n\t[bold yellow]ambiguous, please try again[/bold yellow]\n")
|
||||
return self.prompt_generic(info, default, is_bool=True)
|
||||
|
|
|
@ -84,7 +84,7 @@ class PeopleHandler(GenericHandler):
|
|||
person = obj
|
||||
return person
|
||||
|
||||
elif isinstance(obj, model.User):
|
||||
if isinstance(obj, model.User):
|
||||
user = obj
|
||||
if user.person:
|
||||
return user.person
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue