yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #42384
[Bug 1490031] Fix included in openstack/horizon 9.0.0.0b1
This issue was fixed in the openstack/horizon 9.0.0.0b1 development
milestone.
** Changed in: horizon
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1490031
Title:
Refactor status and admin state translation code to improve
readability
Status in OpenStack Dashboard (Horizon):
Fix Released
Bug description:
In some of the dashboard 'views.py' files, there is code that enables
the detail status and, when applicable, admin state labels to be
translated. The current coding style of these sections is hard to
read. Any and all sections of code that use this style should be
refactored to enhance the code readability.
Example:
Current hard to read code:
https://github.com/openstack/horizon/blob/943a57b536a40f44053c0161f708a78e22469ed0/openstack_dashboard/dashboards/project/images/images/views.py#L112
Possible refactor:
status_label_dict = {value.lower(): label for (value, label) in project_tables.ImagesTable.STATUS_DISPLAY_CHOICES}
image.status_label = status_label_dict.get(image.status.lower(), image.status)
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1490031/+subscriptions
References