Skip to content

Commit

Permalink
feat: improve validation error on unlicensed components
Browse files Browse the repository at this point in the history
Include links to problematic components to make it easier to address.

Issue WeblateOrg#13896
  • Loading branch information
nijel committed Feb 17, 2025
1 parent 71cc94e commit bc0af0f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion weblate/trans/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
UsernameField,
)
from weblate.utils.hash import checksum_to_hash, hash_to_checksum
from weblate.utils.html import format_html_join_comma
from weblate.utils.state import (
STATE_APPROVED,
STATE_EMPTY,
Expand Down Expand Up @@ -2123,7 +2124,13 @@ def clean(self) -> None:
"You must specify a license for these components "
"to make them publicly accessible: %s"
)
% ", ".join(unlicensed.values_list("name", flat=True))
% format_html_join_comma(
'<a href="{}">{}</a>',
(
(component.get_absolute_url(), component.name)
for component in unlicensed
),
)
}
)

Expand Down

0 comments on commit bc0af0f

Please sign in to comment.