Read user project directly from request.user
User project should be read from request.user instead of request.user.token.project. Change-Id: Ic25d34c29698698b9a45fccf823a04dbf9f0b790
This commit is contained in:
parent
5f60007283
commit
e2616fa25d
openstack_dashboard/dashboards/identity/projects
@ -193,7 +193,7 @@ class UpdateCell(tables.UpdateAction):
|
||||
policy_rule = (("identity", "identity:update_project"),)
|
||||
return (
|
||||
(cell.column.name != 'enabled' or
|
||||
request.user.token.project['id'] != cell.datum.id) and
|
||||
request.user.project_id != cell.datum.id) and
|
||||
api.keystone.keystone_can_edit_project() and
|
||||
policy.check(policy_rule, request))
|
||||
|
||||
|
@ -535,7 +535,7 @@ class UpdateProjectInfoAction(CreateProjectInfoAction):
|
||||
def __init__(self, request, initial, *args, **kwargs):
|
||||
super(UpdateProjectInfoAction, self).__init__(
|
||||
request, initial, *args, **kwargs)
|
||||
if initial['project_id'] == request.user.token.project['id']:
|
||||
if initial['project_id'] == request.user.project_id:
|
||||
self.fields['enabled'].widget.attrs['disabled'] = True
|
||||
self.fields['enabled'].help_text = _(
|
||||
'You cannot disable your current project')
|
||||
|
Loading…
x
Reference in New Issue
Block a user