Skip to content

Commit

Permalink
discovery: Avoid creating component with blank name/slug
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jan 26, 2023
1 parent 7df3a3c commit 33432c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion weblate/templates/addons/discovery_preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<tr><th colspan="3" class="info">{% trans "The following components would be created" %}</th></tr>
{% for match in matches_created %}
<tr>
<th>{{ match.0.name }}</th>
<th>{{ match.0.name }} (<code>{{ match.0.slug }}</code>)</th>
<td>
{% if match.0.base_file %}
<strong>{% trans "Monolingual base language file" %}:</strong> <code>{{ match.0.base_file }}</code><br/>
Expand Down
4 changes: 2 additions & 2 deletions weblate/trans/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ def get_val(key, extra=0):
return result

# Get name and slug
name = get_val("name")
slug = get_val("slug")
name = get_val("name") or "Component"
slug = get_val("slug") or "component"

# Copy attributes from main component
for key in COPY_ATTRIBUTES:
Expand Down

0 comments on commit 33432c8

Please sign in to comment.