git +edit setting for "Default branch" marked as "(Optional)" is not optional

Bug #2024136 reported by Barry Price
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

When editing a private git repository, omitting a value for the "Default branch" setting (marked in the UI as "(Optional)" results in the error "Required input is missing."

If the field isn't always optional, it shouldn't be marked as so.

Assuming it is indeed optional in some cases, ideally the form would dynamically figure out whether that's the case and mark it accordingly.

Otherwise the "(Optional)" text should either be removed or clarified.

Tags: trivial ui
Revision history for this message
Ines Almeida (ines-almeida) wrote :

Indeed in GitRepositoryEditView.setUpWidgets() we seem to make it `required = True` if it already exists:

```
if self.context.default_branch:
     self.widgets["default_branch"].context.required = True
```

I assume then when editing (not creating) this always exists already, so it doesn't make sense to have the '(Optional)' there when editing.

tags: added: ui
tags: added: trivial
Changed in launchpad:
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.