Form fields with 'switched' can't be set required=True
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Medium
|
Akihiro Motoki |
Bug Description
Some form fields like class AttachInterface in dashboards/
class AttachInterface
specificati
}))
network = forms.ThemableC
}))
When the value of specification_
set required=True.But when the value is selected as port, the network field is not necessary and the network
field is also be checked and return an error.Now, we need the star when the network is necessary and ignore the
check when it is not necessary.
Changed in horizon: | |
assignee: | nobody → Wangliangyu (wangly) |
> Now, we need the star when the network is necessary and ignore the
check when it is not necessary.
'required' field in a Django form is checked one by one.
IMHO what we need to do is to explore a way to declare "conditionally required" (to show an asterisk mark) rather than skipping the check conditionally. This is because 'required' comes from Django but an asterisk mark is introduced by horizon. We should not change the django behavior of 'required' check. It is better to explore a way to show an asterisk mark for "swit hed" conditional field (with required=False).