Fix mypy issues with the DigitalLibrary plugin

This commit is contained in:
Kostas Karmas 2021-04-22 15:00:42 +02:00
parent 83767764db
commit bc408a5a67
7 changed files with 43 additions and 30 deletions

View file

@ -47,7 +47,7 @@ class DigitalFactoryProjectModel(ListModel):
self._update(df_projects)
def sortProjectsBy(self, sort_by: Optional[str]):
if sort_by:
if sort_by is not None:
try:
self._projects.sort(key = lambda p: getattr(p, sort_by))
except AttributeError: