commit 612942bdf7b3d31349aeb3c408df6d5ae7446cba Author: Walter Doekes Date: Fri Sep 25 13:44:20 2020 +0200 users: Correct lock_password status visibility (Yes/No) in user details Before this change, it would always say No, regardless of actual setting. Change-Id: Ib30d818ecae7b8edd33e94ad2c3c0e2ad8e01822 Closes-Bug: #1897269 diff --git a/openstack_dashboard/dashboards/identity/users/tabs.py b/openstack_dashboard/dashboards/identity/users/tabs.py index 1d483f3..30bcd0a 100644 --- a/openstack_dashboard/dashboards/identity/users/tabs.py +++ b/openstack_dashboard/dashboards/identity/users/tabs.py @@ -72,11 +72,13 @@ class OverviewTab(tabs.Tab): def get_context_data(self, request): user = self.tab_group.kwargs['user'] + options = getattr(user, 'options', {}) return { "user": user, "domain_name": self._get_domain_name(user), 'extras': self._get_extras(user), 'project_name': self._get_project_name(user), + 'lock_password': options.get('lock_password', False), } diff --git a/openstack_dashboard/dashboards/identity/users/views.py b/openstack_dashboard/dashboards/identity/users/views.py index a0702b1..0065295 100644 --- a/openstack_dashboard/dashboards/identity/users/views.py +++ b/openstack_dashboard/dashboards/identity/users/views.py @@ -208,8 +208,6 @@ class DetailView(tabs.TabView): context["user"] = user context["url"] = self.get_redirect_url() context["actions"] = table.render_row_actions(user) - options = getattr(user, "options", {}) - context["lock_password"] = options.get("lock_password", False) return context @memoized.memoized_method