Inappropriate UI in Horizon Dashboard

Bug #1821115 reported by Takashi Kuroda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Riedo Ilofin

Bug Description

Release: OSP 15 Stein

1. Create application credential WITHOUT ticking "Unrestricted (dangerous)" checkbox.
     "Identity" -> "Application Credentials" -> "+Create Application Credential"
2. Show details of application credential created above.
3. "maybe" is shown in "Unrestricted" field.

NOTE 1: Localised UI corresponds to this "maybe" (at lease Japanese).
NOTE 2: In case of checking "Unrestricted (dangerous)", "yes" is shown.

Tags: i18n
Revision history for this message
Takashi Kuroda (tkuroda) wrote :
Revision history for this message
Yuko Katabami (ykatabam) wrote :

I got the following information by an engineer who looked into the code.
It seems that "None" should be changed to "False". It was tested and verified in devstack.
Please take a look.
Hope this is helpful!

[root@devstack horizon]# git diff
diff --git a/openstack_dashboard/dashboards/identity/application_credentials/forms.py b/openstack_dashboard/dashboards/identity/application_credentials/forms.py
index 5b6286f..447524a 100644
--- a/openstack_dashboard/dashboards/identity/application_credentials/forms.py
+++ b/openstack_dashboard/dashboards/identity/application_credentials/forms.py
@@ -94,7 +94,7 @@ class CreateApplicationCredentialForm(forms.SelfHandlingForm):
                 secret=data['secret'] or None,
                 expires_at=expiration or None,
                 roles=roles,
- unrestricted=data['unrestricted'] or None
+ unrestricted=data['unrestricted'] or False
             )
             self.request.session['application_credential'] = \
                 new_app_cred.to_dict()

Revision history for this message
Takashi Kuroda (tkuroda) wrote : Re: [Bug 1821115] Re: Inappropriate UI in Horizon Dashboard

After creating application credential without selecting "Unrestricted
(dangerous)" checkbox,

it was confirmed that "no/いいえ" is shown in "Unrestricted" field as
expected.

Thank you very much.

Taka

On 2019年04月05日 10:18, Yuko Katabami wrote:
> I got the following information by an engineer who looked into the code.
> It seems that "None" should be changed to "False". It was tested and verified in devstack.
> Please take a look.
> Hope this is helpful!
>
>
> [root@devstack horizon]# git diff
> diff --git a/openstack_dashboard/dashboards/identity/application_credentials/forms.py b/openstack_dashboard/dashboards/identity/application_credentials/forms.py
> index 5b6286f..447524a 100644
> --- a/openstack_dashboard/dashboards/identity/application_credentials/forms.py
> +++ b/openstack_dashboard/dashboards/identity/application_credentials/forms.py
> @@ -94,7 +94,7 @@ class CreateApplicationCredentialForm(forms.SelfHandlingForm):
> secret=data['secret'] or None,
> expires_at=expiration or None,
> roles=roles,
> - unrestricted=data['unrestricted'] or None
> + unrestricted=data['unrestricted'] or False
> )
> self.request.session['application_credential'] = \
> new_app_cred.to_dict()
>

Revision history for this message
Yuko Katabami (ykatabam) wrote :

I was suggested that the following is probably where the string "maybe" is coming from:
https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#yesno

Riedo Ilofin (r9n)
Changed in horizon:
assignee: nobody → Riedo Ilofin (r9n)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/651678

Changed in horizon:
status: New → In Progress
Changed in horizon:
assignee: Riedo Ilofin (r9n) → Ivan Kolodyazhny (e0ne)
Changed in horizon:
assignee: Ivan Kolodyazhny (e0ne) → Riedo Ilofin (r9n)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/651678
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=413e4b6d51780273a802ec9a5b819d324242d2d8
Submitter: Zuul
Branch: master

commit 413e4b6d51780273a802ec9a5b819d324242d2d8
Author: Riedo Ilofin <email address hidden>
Date: Thu Apr 11 10:56:02 2019 +1000

    Application Credentials: Set unrestricted Default to False

    This is bug from initial commit Ida2e836cf81d2b96e0b66afed29a900c312223a4

    Check box 'unrestricted' is Bool type and if left unticked it was set to
    'None' which is not Bool type.

    This fixes the bug and removes 'or None' which sets the 'unrestricted' to
    'False'

    Change-Id: I7b3b4b82624e61edfea5d0b42d9179ec2216277f
    Closes-Bug: #1821115

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 16.0.0.0b1

This issue was fixed in the openstack/horizon 16.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.