Compare commits
2 commits
0147b56d69
...
794b28f833
| Author | SHA1 | Date | |
|---|---|---|---|
| 794b28f833 | |||
| 0dc1f22abf |
2 changed files with 10 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ random.seed()
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from django.contrib.auth import authenticate, login, logout
|
from django.contrib.auth import authenticate, login, logout, update_session_auth_hash
|
||||||
from django.template import loader
|
from django.template import loader
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.mail import send_mail, BadHeaderError, EmailMessage
|
from django.core.mail import send_mail, BadHeaderError, EmailMessage
|
||||||
|
|
@ -719,7 +719,9 @@ def editPreferences(request, data):
|
||||||
profile.save()
|
profile.save()
|
||||||
if 'password' in data:
|
if 'password' in data:
|
||||||
change = True
|
change = True
|
||||||
request.user.set_password(data['password'])
|
user = request.user
|
||||||
|
user.set_password(data['password'])
|
||||||
|
update_session_auth_hash(request, user)
|
||||||
if 'script' in data:
|
if 'script' in data:
|
||||||
profile = request.user.profile
|
profile = request.user.profile
|
||||||
profile.preferences['script'] = data['script']
|
profile.preferences['script'] = data['script']
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ pandora.ui.preferencesDialog = function() {
|
||||||
id: 'password',
|
id: 'password',
|
||||||
label: Ox._('New Password'),
|
label: Ox._('New Password'),
|
||||||
labelWidth: 120,
|
labelWidth: 120,
|
||||||
type: 'password',
|
type: 'text',
|
||||||
validate: pandora.validateNewPassword,
|
validate: pandora.validateNewPassword,
|
||||||
width: 320
|
width: 320
|
||||||
})
|
})
|
||||||
|
|
@ -51,6 +51,11 @@ pandora.ui.preferencesDialog = function() {
|
||||||
autocomplete: 'new-password'
|
autocomplete: 'new-password'
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
|
focus: function(data) {
|
||||||
|
this.options({
|
||||||
|
type: 'password'
|
||||||
|
})
|
||||||
|
},
|
||||||
validate: function(data) {
|
validate: function(data) {
|
||||||
data.valid && pandora.api.editPreferences({password: data.value});
|
data.valid && pandora.api.editPreferences({password: data.value});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue