django.utils.translation.ugettext(), ugettext_lazy(), ugettext_noop(),
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.utils.translation.gettext(),
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().
https://docs.djangoproject.com/en/4.0/releases/3.0/#id3
Change-Id: I77878f84e9d10cf6a136dada81eabf4e18676250
It seems Django 3.0+ does not allow to set an unknown attribute
to forms.Form.fields. "keyOrder" attribute has no meaning and
"field_order" of the Form class is the right way to configure
the order of fields.
Change-Id: Ib3a631a3626977a2e7114dac217aacd523354c53
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.
pylint provides a check for this.
Let's enable 'super-with-arguments' check.
NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.
Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.
Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
Kyestone V2 support was removed in Train, so it's safe to do such cleanup.
* Functions which just return horizon settings are dropped and
the settings are referred directly now.
* The service catalog in the sample test data is updated to match
the format of the keystone API v3.
* Related to the above change of the sample service catalog,
openstack_dashboard.test.unit.api.test_keystone.ServiceAPITests is
updated to specify the region name explicitly because 'RegionTwo'
endpoint is no longer the second entry of the endpoint list in the
keystone API v3.
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ib60f360c96341fa5c618595f4a9bfdfe7ec5ae83
This feature was added in Keystone V3 API. Proposed patch adds support
to Horizon
Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info>
Closes-bug: #1766485
Change-Id: Ic20a58c76826d703b43fa6a2d77ae5f77dcda1f4
There are cases where leading/trailing spaces are included in passwords
We should not touch passwords input in forms and pass them to auth
backends without any modifications. The detail was discussed in
the mailing list thread [1] referred in the bug comment.
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-January/thread.html#12223
Change-Id: I98de224cc77a98fa216ec3bc032412325e661e14
Closes-Bug: #1861224
When keystone has password_regex set and the new password doesn't match
it, the attempt to change the password will fail, and keystone will
helpfully include password_regex_description in its error message.
Unfortunately Horizon discards that and displays "Unable to update the
user password.", which is considerably less helpful.
This change extracts the description from the error message in this
case, and displays it to the user together with a translated error
message. Unfortunately we have no way of also translating the
description.
Closes-bug: #1838003
Change-Id: I535c020deed76188c0f7150072fbdced9c5454fc
This commit mainly covers settings
in openstack_dashboard/dashboards/identity/.
Part of blueprint ini-based-configuration
Change-Id: Ibb174f62d0047a10b2832dd2ff350f5f32955b08
Sorts the available project and role names in the Primary
Project and Roles combos respectively when creating a new
user through the identity dashboard/create user dialog.
Change-Id: Ia488d598727dfc11ec4b8bc7f8f2fd3f6aa7fde6
Closes-Bug: 1713497
Co-Authored-By: Ales Krivak <ales.krivak@ultimum.io>
How to reproduce the bug:
P.S. Using the horizon master(pike) codebase
1) Login as an admin user
2) Click Identity and go to the Users panel
3) Create a user and put an email address with that user
4) Then edit this user to clear the email address.
5) Update the user and even though we have a green banner(successful)
show up, the email address still viewable and do not disappear.
Closes Bug: #1573479
Change-Id: I0273d0c6d885c77f1f74bdc2ae6674d1e6539ac0
If a member role user login and use admin to get keystoneclient,
but he is not a super user, then a notAuthorized exceptions will be raised,
it seems to be unreasonable.
The following actions will throw unauthorized exception.
Go to Users panel, Click user name , Click Change Password,
Submit Change Password form.
Change-Id: I4f6486b92f023ad0daecfff51e3a1ed16b0e78c0
Closes-Bug: #1684475
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.
After this, there are only 3 noqa under openstack_dashboard/ :)
Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
This change is to support extra properties in project and user.
To show an extra property in project/user table, you can customize.
The explanation of the method to add an extra property is added
by this patch.
In addition, when you do a create or update user, you can specify a
value of extra property by setting in local_settings.py
Change-Id: Ifee491f2a55d9207fe5da70136f749e1fc4bab82
Implements: blueprint support-extra-prop-for-project-and-user
Horizon was using a standard select input. Unfortunately, this type
of input is only customizable to a small extent.
Co-Authored-By: Matthew Wood <woodm1979@gmail.com>
Co-Authored-By: Brian Tully <brian.tully@hp.com>
Change-Id: If2e17ddef448f4867755280296a35e9fd9e8f4fc
Partially-implements: blueprint horizon-theme-css-reorg
the error was in condition "if > 1", which was allowing
the default value only when the list had two or more values.
Change-Id: If2ce5a5a3cb5f6411df0c023a818f20fa2130768
Closes-Bug: #1581635
The selector for setting the default project passes on an empty string
if the value is not changed. This is causing an error from keystone as
an empty string is not a valid project ID.
To fix, a couple of things have been done:
First, as user_update is a PATCH, we no longer pass on the default
project as a parameter in the update when using keystone v3
and the value did not change when editing the user.
Second, there is currently no way to unset the default project
using keystoneclient. An entry in the default project select
"select a project" has been removed when the default project is
already set. The entry was selectable and resulted in the
problematic empty string. The current default project is already
selected at load time. The ability to select a different default
project is maintained.
Additionally, keystone v2.0 functionality is not effected, as the
default project id is required in v2.0.
A test was added to cover the case of editing the default project.
Closes-Bug: #1561612
Change-Id: I3c84ee5c7af846b5a58f2dd0342a537d312323cf
This patch supports using domain scoped tokens against keystone v3.
Use Cases:
Cloud Admin - view and manage identity resources across domains
Domain Admin - view and manage identity resources in the domain logged in
User - view identity project in the domain logged in
Regression:
Supports keystone v2 through local_settings.py configuration
Supports keystone v3 with multidomain = False
Supports keystone v3 with mulitdomain = True
Relates to https://review.openstack.org/#/c/141153/
Background on how to test is here
https://wiki.openstack.org/wiki/Horizon/DomainWorkFlow
Co-Authored-By: Brad Pokorny <Brad_Pokorny@symantec.com>
Co-Authored-By: Brian Tully <brian.tully@hp.com>
Co-Authored-By: Michael Hagedorn <mike.hagedorn@hp.com>
Co-Authored-By: woomatt <matt.wood@hp.com>
Partially Implements: blueprint domain-scoped-tokens
Closes-Bug: #1413851
Change-Id: Iaa19bfef9b0c70304ff81d083c62b218b2d02479
This patch removes all code workarounds in Horizon for Django versions
before 1.8. As a bonus, this means an extra unit test is run that was
previously skipped.
Change-Id: I63f56953d9beefd3ea596d3e31c6032e936b140c
Partially-Implements: blueprint drop-dj17
When editing the user by the user Update Form
make sure that if the description field has not changed
to not send it, as it will be saved as empty string.
Instead, the value should be absent from the user object,
so it respects the same values as users created in keystone
directly.
Unfortunately, inline editing still triggers the issue
as there is no good way of checking the initial value
without making an extra call.
Change-Id: Id2e0b3c589855068cbc15adc75b57ff0bf61a1b9
Partial-Bug: 1519579
In keystone v3, the parameter to create user for the the default project
has changed from project to default_project and is no longer honored and
throws an exception. Also passing in '' rather than None causes keystone
issues, so moving to None.
Closes-Bug: #1478143
Change-Id: I73423433a42bf46769065a269a3c35f27175f185
In create user form, no way to set the user is disabled.
by default it is setting the user as enabled.
This patch adding the Boolean field to set enable and disable the user
at the time creating.
Change-Id: If4bf8ef077326658d4693858144904c7a93f1eb5
Closes-Bug: #1468208
In the user table, description column is missing when using keystone V3
This patch add the 'Description'column in User table. This also
change to add 'Description' field the user_create and user_update form.
Change-Id: I90bb7a644f8f29ae0055c6c2ffc688a9b709f300
Closes-Bug: #1463247
Starting from Django 1.7 self.fields.keyOrder no longer works for
setting fields ordering, need to rearrange fields there by recreating
underlying OrderedDict.
Change-Id: If0f4c7014a7a68f2ff0d0f2cb06f7b1c2e28436b
Closes-Bug: #1465221
Add a new setting to enable a new textbox field on the Change
Password form that will double check the logged-in Admin
user's password.
For example if the logged-in admin leaves an unattended computer,
someone can change the password of the logged in user successfully.
Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com>
Change-Id: Icafa8ce8ab30ec43d3f6419a77118a634a163870
Closes-Bug: #1387372
Based on inline TODO comment.
Code refactor.
Fix unused test case (was not used as helper method and
was not prefixed with 'test_' so it was not used).
Change-Id: Ie696970b4b61d699cc4afa5174248df6c00c688d
Closes-Bug: #1402047
Change error message when we try rename user
name with an existing user name.
Change-Id: I2dbf9fee3c682a70c77544a8dd6b925311a3f019
Closes-Bug: #1389132
New variable added to form to specify whether it should autofill or
not. This updates the modal forms autocomplete attribute. Hidden
fields are required because Chromium v34+ based browsers ignore the
autocomplete=off form attribute, so the hidden fields catch autofill
data. Any form without self.no_autocomplete = True will just act
like before.
Change-Id: Ibb1722023eea8f57312e1133939d1f75cd909467
Closes-Bug: 1352459
Moving identity panels to their own dashboard.
RBAC is now used to determine the data to load in the identity
dashboard. Using the default policy file, a user with role member
will now be able to see their project list.
Also, adding a policy check mechanism at the panel and dashboard
level to determine which panels and dashboards the user can access.
Implements blueprint separate-identity-dash
Change-Id: I7ebfec2bf6e44899bec79d3b23c90d56a976200f