Skip to content

Commit

Permalink
Format preboot list
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed Jul 5, 2024
1 parent f7096c6 commit f157428
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ralph/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,21 +785,20 @@ def get_preboots():
(p.id, p.name) for p in Preboot.active_objects
.exclude(id__in=[p[0] for p in warnings + criticals])
]
yield from good + warnings + criticals
return good + warnings + criticals
except ProgrammingError:
# This is weird, but because of the time get_preboots() is called it's needed
# to make everything work
return Preboot.objects.all()
return [(p.id, p.name) for p in Preboot.objects.all()]


@deployment_action(
verbose_name=_('Apply preboot'),
form_fields={
'preboot': {
'field': forms.ModelChoiceField(
'field': forms.ChoiceField(
label=_('Preboot'),
queryset=get_preboots(),
empty_label=None
choices=get_preboots()
),
}
},
Expand Down

0 comments on commit f157428

Please sign in to comment.