Fix rollout platforms only saving 1 platform on the edit all page (#3091)
This commit is contained in:
Родитель
03b0130563
Коммит
3661674a10
|
@ -81,9 +81,6 @@ export function formatFeatureForEdit(feature) {
|
|||
|
||||
// from feature.browsers.other
|
||||
other_views_notes: feature.browsers.other.view.notes,
|
||||
|
||||
rollout_platforms: Array.from(new Set((feature.rollout_platforms || [])
|
||||
.map(x => parseInt(x).toString()))),
|
||||
};
|
||||
|
||||
COMMA_SEPARATED_FIELDS.map((field) => {
|
||||
|
|
|
@ -338,8 +338,7 @@ class FeatureEditHandler(basehandlers.FlaskHandler):
|
|||
elif field_type == 'str':
|
||||
return self.form.get(field)
|
||||
elif field_type == 'split_str':
|
||||
val = self.split_input(field, delim=',')
|
||||
if field == 'rollout_platforms' or field == 'enterprise_feature_categories':
|
||||
if 'rollout_platforms' in field or field == 'enterprise_feature_categories':
|
||||
val = self.form.getlist(field)
|
||||
# Occasionally, input will give an empty string as the first element.
|
||||
# It needs to be removed.
|
||||
|
@ -348,6 +347,7 @@ class FeatureEditHandler(basehandlers.FlaskHandler):
|
|||
return val
|
||||
elif field == 'blink_components' and len(val) == 0:
|
||||
return [settings.DEFAULT_COMPONENT]
|
||||
val = self.split_input(field, delim=',')
|
||||
return val
|
||||
raise ValueError(f'Unknown field data type: {field_type}')
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче