3
0
Fork 0

fix: fix 'no-else-return' for pylint

This commit is contained in:
Lance Edgar 2025-08-30 19:11:01 -05:00
parent 6ac1cacdb3
commit e845c66d86
4 changed files with 16 additions and 16 deletions

View file

@ -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,

View file

@ -88,30 +88,29 @@ class UUID(sa.types.TypeDecorator):
""" """
if dialect.name == "postgresql":
return dialect.type_descriptor(PGUUID())
else:
return dialect.type_descriptor(sa.CHAR(32))
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
if not isinstance(value, _uuid.UUID):
return "%.32x" % _uuid.UUID(value).int
# hexstring
return "%.32x" % value.int
def process_result_value(self, value, dialect): # pylint: disable=unused-argument,empty-docstring
""" """
if value is None:
return value
else:
if not isinstance(value, _uuid.UUID):
value = _uuid.UUID(value)
return value
if not isinstance(value, _uuid.UUID):
value = _uuid.UUID(value)
return value
def uuid_column(*args, **kwargs):

View file

@ -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)

View file

@ -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