Skip to content

Commit 444d1ae

Browse files
committed
Fix empty maintainer email being displayed
1 parent 81a3937 commit 444d1ae

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

package_list.py

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -389,19 +389,35 @@ def _setup_composite_view(self, addon: Addon) -> None:
389389
self.widget.ui.labelDescription.setText("")
390390

391391
def _set_package_maintainer_label(self, addon: Addon):
392+
392393
maintainers = addon.metadata.maintainer
393-
maintainers_string = ""
394-
if len(maintainers) == 1:
395-
maintainers_string = (
396-
translate("AddonsInstaller", "Maintainer")
397-
+ f": {maintainers[0].name} <{maintainers[0].email}>"
398-
)
399-
elif len(maintainers) > 1:
400-
n = len(maintainers)
401-
maintainers_string = translate("AddonsInstaller", "Maintainers:", "", n)
394+
395+
text = ""
396+
397+
count = len(maintainers)
398+
399+
if count > 0:
400+
401+
#
402+
# FIXME
403+
# - This should be one translation
404+
# - The translation string shouldn't contain ':'
405+
#
406+
407+
text = translate("AddonsInstaller", "Maintainers", "", count)
408+
text = f"{ text }: "
409+
402410
for maintainer in maintainers:
403-
maintainers_string += f"\n{maintainer.name} <{maintainer.email}>"
404-
self.widget.ui.labelMaintainer.setText(maintainers_string)
411+
412+
if count > 1:
413+
text += "\n"
414+
415+
text += maintainer.name
416+
417+
if maintainer.email:
418+
text += f" <{ maintainer.email }>"
419+
420+
self.widget.ui.labelMaintainer.setText(text)
405421

406422
def _set_macro_maintainer_label(self, repo: Addon):
407423
if repo.macro.author:

0 commit comments

Comments
 (0)