~ubuntu-branches/ubuntu/trusty/horizon/trusty-updates

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/settings/password/forms.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-09-06 11:59:43 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20130906115943-h3td0l7tp16mb9oc
Tags: 1:2013.2~b3-0ubuntu1
* New upstream release.
* debian/control: Minimum python-openstack-auth version >= 1.1.1.
* debian/control: Add python-troveclient.
* debian/static: Refresh static assets for 2013.2~b3.
* debian/patches: ubuntu_local_settings.patch -> ubuntu_settings.patch, also
  patch location of secret key in openstack_dashboard/settings.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#    License for the specific language governing permissions and limitations
15
15
#    under the License.
16
16
 
17
 
from django.forms import ValidationError
18
 
from django.utils.translation import ugettext_lazy as _
19
 
from django.views.decorators.debug import sensitive_variables
 
17
from django.conf import settings  # noqa
 
18
from django.forms import ValidationError  # noqa
 
19
from django import http
 
20
from django.utils.translation import ugettext_lazy as _  # noqa
 
21
from django.views.decorators.debug import sensitive_variables  # noqa
20
22
 
21
23
from horizon import exceptions
22
24
from horizon import forms
23
25
from horizon import messages
 
26
from horizon.utils import functions as utils
24
27
from horizon.utils import validators
25
28
 
26
29
from openstack_dashboard import api
53
56
 
54
57
        if user_is_editable:
55
58
            try:
56
 
                passwd = api.keystone.user_update_own_password(request,
 
59
                api.keystone.user_update_own_password(request,
57
60
                                                    data['current_password'],
58
61
                                                    data['new_password'])
59
 
                messages.success(request, _('Password changed.'))
60
 
            except:
 
62
                response = http.HttpResponseRedirect(settings.LOGOUT_URL)
 
63
                msg = _("Password changed. Please log in again to continue.")
 
64
                utils.add_logout_reason(request, response, msg)
 
65
                return response
 
66
            except Exception:
61
67
                exceptions.handle(request,
62
68
                                  _('Unable to change password.'))
63
69
                return False