41 Commits

Author SHA1 Message Date
Akihiro Motoki
baa4ca8dce hacking: noqa cleanup in openstack_dashboard
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
2017-03-17 19:38:47 +00:00
Jenkins
93904437f4 Merge "The background colour of the success message changed" 2017-03-06 05:01:44 +00:00
Sharat Sharma
618d4e1737 The background colour of the success message changed
When the password is successfully changed, the background colour
of the success message is changed from red to green to avoid
users mistaking it for an error message.

Change-Id: Icbaae9f15d02368539e47cd5e929c19ed67b5fed
Closes-Bug: #1520486
2017-01-18 06:53:09 +00:00
zhurong
316fedfb5b Make sure new password can not the same with old one
change password same with old one will give the error:
Error: Unable to change password.
This patch make sure new password can not the same with old one.

Change-Id: Ib2261df262ba9bdf2b6d2ecb9cf5ce406893634d
Closes-bug: #1641046
2016-11-11 16:08:46 +08:00
liyingjun
b8624947f2 UX: Remove duplicated view title under Settings section
Under Setttings -> User Settings OR -> Change Password
There are two title elements with the same content and shown in the same
area, remove one for better ux.

Change-Id: I863363d8fc79f5144d8ead750ba48878a7fa251b
Closes-bug: #1583319
2016-06-15 14:24:26 +08:00
Jenkins
dc8c01c929 Merge "Update URLs to Django 1.8+ style" 2016-04-11 18:10:51 +00:00
Rob Cresswell
15e83c6448 Update URLs to Django 1.8+ style
Django 1.8 altered and deprecated the existing pattern for defining
URLs. This will be removed in 1.10, meaning that many deprecation
warnings show up under Django 1.9. We should fix the URLs promptly to
avoid logspam, and to support Django 1.10 in Newton.

See
https://docs.djangoproject.com/en/1.9/releases/1.8/#django-conf-urls-patterns

Change-Id: I074d20850de59bfe678a3bc72e9f0f25bd743cbf
Partially-Implements: blueprint dj110
2016-03-28 11:03:08 +01:00
zhu.rong
1546981cc6 Change the super argument to use the current class
Change the super argument to use the current class not use the parent class

Change-Id: Idfa64561cb474bf2d23ac1a3e23e62b173695cd8
2015-11-25 15:41:37 +08:00
Richard Jones
89ce71c4e9 Remove some old (pre-1.8) Django compatibility code
These lines of code were introduced as Horizon migrated
through several Django versions and are no longer
needed.

Change-Id: I12aae1a843fccc803859da6337a3274339a3741f
Partially-Implements: blueprint drop-dj17
2015-11-06 06:55:22 +00:00
Victor Stinner
674a45ffe0 Replace mox with mox3
mox doesn't work on Python 3, whereas mox3 works on Python 2 and Python
3. Cinder, Nova and many other projects already replaced mox with mox3.
mox3 is now maintained by OpenStack.

Partial-Implements: blueprint porting-python3
Change-Id: I10e6a9754ebd58a2640d73ec8966527c3aa1fe9a
2015-07-13 15:02:10 +02:00
Rob Cresswell
95fdaedc49 Refactor modal forms for Settings dashboard
Refactor of User settings & Password modals
Based on merged patch: https://review.openstack.org/#/c/123472/

Change-Id: Ibadfda67edc6c8c2c0a9c42c7f0ec982497005ef
Partially-Implements: blueprint form-template-to-view
2015-02-22 13:00:24 +00:00
Jenkins
7d36214474 Merge "Reduce page title duplication in settings and test" 2015-02-17 16:13:28 +00:00
Wu Wenxiang
d08868cd31 Remove unused import NoReverseMatch
Remove unused import NoReverseMatch in file:
openstack_dashboard/dashboards/settings/password/tests.py

Change-Id: Iede897000063e8fae0f60c2650e3430c0896d30f
2015-02-14 00:20:49 +08:00
Sam Betts
49f844024a Reduce page title duplication in settings and test
Patch https://review.openstack.org/#/c/142802 adds a method of
reducing duplication of page title logic, this patch applies that change
to the project settings and the test panel views.

Change-Id: I4af59bb3c051dcd24e46aacd91c49b8fcc6c10c7
Partial-Bug: 1413749
2015-02-12 13:07:27 +00:00
Julie Pichon
11c21626c0 Integration test for showing logout message (password change)
This replaces the unit test that had to be disabled.

Change-Id: I0921bd1164a10d0d33a8f00e522ae47ebdf4887e
Closes-Bug: #1333144
2015-01-06 15:09:43 +00:00
Akihiro Motoki
832a741c88 Fix E128 errors in remaining openstack_dashboard/
E128 continuation line under-indented for visual indent

Closes-Bug: #1375929
Change-Id: I2a72313d359bdfe2e2667eba5d3bf9744ec8f60a
2014-10-16 16:53:52 +09:00
Yves-Gwenael Bourhis
4824239730 Checking session timeout before authentication
If both the keystone token and the session expired, the user was asked to login
twice. This is because the token expiration was not checked.
When a user had timed out both in session and keystone token validity, the user
was asked to log in, then the timestamp was checked, and the user logged out
again and asked to log in a second time.

We now check both the timestamp and keystone token validity before
authentication validity and force back the login page to retrieve a new
keystone token, avoiding the timeout race condition between session and token
validity which was forcing a dual login. A keystone token expiration is now
considered as a session timeout too.

Also, a page can start loading while the token is valid, and finish while it's
invalid. This was leading to errors during the page loading.
We now set a TOKEN_TIMEOUT_MARGIN period in seconds which allows defining
a margin before which we consider the token as expired.
This is a configurable parameter in the django settings because the time a page
takes to render is infra and deployment specific. This margin is preset to
ten seconds.

Requires: https://review.openstack.org/101556

Closes-Bug: 1308918

Change-Id: I0bf0d079a9dc000c1a30f0e20dcaa03b22d63e51
2014-09-25 15:06:19 +02:00
Jenkins
6b266b2788 Merge "Added no_autocomplete attribute to password form" 2014-09-24 09:39:48 +00:00
Sam Betts
3ab0cfc574 Added no_autocomplete attribute to password form
Change-Id: Ice1a718e190fb53cdf6c60b305122d36a93f7672
Closes-Bug: 1369880
2014-09-16 15:26:57 +01:00
Tatiana Ovchinnikova
539c14e1c6 Remove #noqa from two common imports and add them to import_exceptions
We have two imports with #noqa: django.conf.urls.patterns and
django.conf.urls.url however using them is a standard way of creating
any urls.py module. So there are over 150 imports in Horizon code
where #noqa could be replaced with two lines in list of import_exceptions.

Change-Id: I81c3290e0dc958b5037dd6a87e44df18adfbe751
2014-09-16 14:08:28 +04:00
Jenkins
f84e3f00a9 Merge "User keystone policy to check if user password can be updated" 2014-09-09 15:58:22 +00:00
Ashish Chandra
80d05a5c3d Improve help messages on modals
Some general guidelines:
1. Removed contractions
2. Changed "Info" to "Information"
3. Removed the "From here you can..." at the beginning of messages.
4. Explained concepts to users instead of just reiterating the modal
title. Thanks Jeff Calcaterra!

Co-Authored-By: Cindy Lu <clu@us.ibm.com>
Closes-Bug: #1329984

Change-Id: I35af81953cafcbafc28c31b3ce305e8c5e21fe84
2014-08-27 16:12:18 -07:00
liyingjun
2e0444b97b User keystone policy to check if user password can be updated
Keystone have a policy for change password, we need to apply this to
horizon too.

policy:
  "identity:change_password": "rule:admin_or_owner"

Change-Id: Idd35646f9cbe4fadaa96bc85b243ed4f7823d9dd
Closes-bug: 1347354
2014-08-07 22:08:02 +08:00
Jiri Tomasek
92146772b6 Update Twitter Bootstrap to version 3
Updated to bootstrap 3.2.0
back to v3.1.1
fix base-line-height variable
Revamped grid system
Replaced help-inline with help-block
Change .control-group to .form-group
Add column widths to horizontal form labels and .controls, remove .controls class
Datepicker form fix
Add btn-default to btn elements with no other color
Topbar switcher fix
Rename button sizes
Replace alert-error with alert-danger
Removed alert-block
Alerts fixing
Updated LinkAction and Action table actions to define icon, replaced btn-default icon with glyphicon
Replaced icons with glyphicons, removed btn-icon styling from horizon.scss
change Button Icons text in customizing docs
Fixed table header
Fix page_header h2 margin
Nav accordion fix
Tables fix
Modal fixes
added form-control class to input and selects
Forms fixes
Workflow modal fix
Fix quota bar
updated customizing docs
removed unused styling from horizon.scss
make datepicker form inline
fix table filter styling
added btn-danger to terminate instances button
fixed loading spinner
form fields and validations
Created bootstrap_form_field filter and template to render bootstrap forms properly
Style up the datepicker
Fixed failing test cases

Implements: blueprint bootstrap-update

Change-Id: Ic826849be1af7fc6bf06f97dd7a60fc54b862148
2014-07-28 16:13:21 +02:00
Julie Pichon
5455b8f6f5 Disable broken unit test (related to "Change Password")
The new django_openstack_auth 1.1.6 library surfaced a defect in this
test, whereby the test client does not properly log out the user. This
only affects the test, the functionality otherwise works fine.

This temporarily disables the test in order to repair the gate, while
waiting to replace it with a new unit test more reduced in scope and/or
an integration test.

Change-Id: I8779666c053a4835e22038a39a530fe5fc84b6a3
Partial-Bug: #1333144
2014-06-23 14:15:06 +01:00
Zhenguo Niu
5f354a5cad Remove the unused success_url and return
Since 'Change Password' form handle successfully return
httpResponseRedirect(settings.LOGOUT_URL), it's no need
to set success_url and never reach the 'return True' at
the end.

Change-Id: I47c8888b07d06044fec8f06042d4ef6401e77097
Closes-Bug: #1331329
2014-06-19 01:09:02 +00:00
He Yongli
e790ac070e Remove extraneous vim configuration comments
Remove vim setting:
comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4

at the top of source code files, except for files in
openstack/common.

Change-Id: I9a5c6b17c6ef7ecec601f4503dfc7b31fc72e90a
Close-bug: #1229324
2014-05-06 15:30:10 +08:00
Zhenguo Niu
e027878791 Enable settings/change password on keystone v3
There is a new API in v3 for users to update their own password.

Change-Id: I30e1f4682dab6e29968f38f04fa71e0e3720d5e1
Closes-Bug: #1239757
2014-03-27 20:24:25 +08:00
Radomir Dopieralski
028332da4a Remove #noqa from most common imports and add them to import_exceptions
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.

I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.

I also removed a few unused imports that were revealed in the process.

Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
2014-01-07 12:26:35 +01:00
Kieran Spear
311b6299c5 Fix django.conf.urls.defaults imports
These imports aren't available in Django 1.6. We need to use
django.conf.urls instead.

Partially-implements blueprint django-1point6

Change-Id: I692439a76de4fe5abff9ab9395bad5c10f1cdbba
2013-11-04 17:10:57 +11:00
Matthias Runge
417068b492 Hide settings/change password on keystone v3
When using keystone v3, it was possible to change the user
password without knowing the old password.

Change-Id: I2e3721f9c8a1de4b9a5f85b230432844d2c83507
Closes-Bug: 1237989
2013-10-14 11:03:41 +02:00
Julie Pichon
85f4c8b473 Display a message on the login page
In some cases, particularly when having to log the user out after
performing some action (e.g. password change), we want to display a
friendly message on the login screen to explain to the user why they
have been redirected to the login page.

This adds a function to do so, and uses it in a couple of places:
 - When updating one's own password using the Settings panel
 - Session time out
 - HTTP 401

Change-Id: Ie53c5552159304e1f1304ac6211b3accfd9aa623
Implements: blueprint messages-on-login-page
2013-08-30 19:54:31 +01:00
Tatiana Mazur
b4fc9b4bc9 Small "H302 check" cleanup
This patch set removes some commented out stuff that
has been unintentially left in "H302 check" patch set.
It also replaces a couple more method imports with
module imports.

Fixes bug 1215892

Change-Id: I35fd880154a4ea6d6d8d3b3615103c271aa4a005
2013-08-23 18:07:08 +04:00
Tatiana Mazur
953d1b9793 Enable H302 check
This patch replaces some method imports with module imports and
makes H302 test enabled.

Fixes bug 1188531

Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
2013-08-22 17:39:09 +04:00
Kieran Spear
242c8df495 Enable H201: do not write "except:"
Fixes all occurrences of this. We have a custom exception handler
in Horizon anyway that only catches ClientException in most of these
cases, but this commit lets us gate on the other cases.

Change-Id: Iea3dc13817f3e5b775b2024424bf3a906da5584b
Closes-Bug: #1211657
2013-08-13 17:21:32 +10:00
Alex Gaynor
56ae8fdfc5 Enable pep8 F841 checking.
This check looks to see whether a local variable
is unused. Also fixed all violators of said check.

Change-Id: I7c186df41b5601078ffc54588aace8136c6576bd
2013-07-22 01:09:52 -07:00
Tatiana Mazur
3087c3486b Enable H304 check
This patch replaces relative imports with full paths and
makes H304 test enabled.

Fixes bug 1188535

Change-Id: I47254cf9a790727102f7993d0fd107da514983df
2013-07-16 18:49:56 +04:00
Dirk Mueller
e4ea445a5f Fix Further Pyflakes warnings
Fix occurences of F811 and F821.

Change-Id: I961e62e818ab846f7e1bbc1fdabfe8c051fd70eb
2013-06-26 09:16:28 +02:00
Matthias Runge
cea720e793 Sort imports alphabetically
This patch also re-organizes imports to import one per line.

Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
2013-06-14 12:05:55 +02:00
Matthias Runge
4ac70a732a remove unused imports
In the move to make flake8 tests stricter, we need a code
cleanup earlier.
This removes all unused imports and also enables tests to prevent
them for the future.

This patch also includes the checks on __init__.py files.

Change-Id: I34055803f7c4726682ac6fb95cc5b50ba761fec8
Fixes: bug 1188134
2013-06-13 07:51:10 +02:00
Zhenguo Niu
2a97ce9602 Allow users to change their passwords
Add change password panel on settings dashboard to enable users
to change their passwords

Change-Id: Ibfea2592e13aab3cc4892dce77ab62dcba65eacc
Implements: blueprint change-user-passwords
2013-05-22 09:32:28 +08:00