Skip to content

Commit

Permalink
Merge branch 'master' into TP2000-1654-missing-index
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisella21 authored Jan 14, 2025
2 parents c90a4b1 + 5c92e5e commit b649797
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions quotas/forms/wizards.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ def init_fields(self):
self.fields["measurement_unit"].label_from_instance = (
lambda obj: f"{obj.code} - {obj.description}"
)
self.fields["measurement_unit_qualifier"].queryset = self.fields[
"measurement_unit_qualifier"
].queryset.order_by("code")
self.fields["measurement_unit_qualifier"].label_from_instance = (
lambda obj: f"{obj.code} - {obj.description}"
)
self.fields["measurement_unit_qualifier"].help_text = (
"A measurement unit qualifier is not always required"
)
Expand Down Expand Up @@ -559,6 +565,15 @@ def init_fields(self):
if "description" in definition_data:
fields["description"].initial = definition_data["description"]

self.fields["measurement_unit_qualifier"].help_text = (
"A measurement unit qualifier is not always required"
)
self.fields["measurement_unit_qualifier"].queryset = self.fields[
"measurement_unit_qualifier"
].queryset.order_by("code")
self.fields["measurement_unit_qualifier"].label_from_instance = (
lambda obj: f"{obj.code} - {obj.description}"
)
if (
"measurement_unit_qualifier" in definition_data
and definition_data["measurement_unit_qualifier"] != "None"
Expand All @@ -576,9 +591,6 @@ def init_fields(self):
definition_data["threshold"],
)
fields["quota_critical"].initial = definition_data["quota_critical"]
self.fields["measurement_unit_qualifier"].help_text = (
"A measurement unit qualifier is not always required"
)

def update_definition_data_in_session(self, cleaned_data):
cleaned_data.update(
Expand Down

0 comments on commit b649797

Please sign in to comment.