Skip to content
Snippets Groups Projects
Commit c0fdba62 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Update the label on the action field

parent 99d3cb2b
No related branches found
No related tags found
No related merge requests found
......@@ -13,8 +13,9 @@ class ProgressSubmissionForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
choices = [(action, action) for action in self.instance.phase.action_names]
self.fields['action'].choices = choices
self.fields['action'].label = self.instance.phase.name
action_field = self.fields['action']
action_field.choices = choices
action_field.label = f'Current status: {self.instance.phase.name}'
self.should_show = bool(choices)
def save(self, *args, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment