1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00

fix user not found while editing user profile

This commit is contained in:
catborise 2020-09-25 09:21:37 +03:00
parent 2fe1f1c73a
commit aee7fa34b8

View file

@ -1,6 +1,5 @@
import os import os
import sass
from django.contrib import messages from django.contrib import messages
from django.contrib.auth import update_session_auth_hash from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.decorators import permission_required from django.contrib.auth.decorators import permission_required
@ -13,7 +12,6 @@ from django.utils.translation import ugettext_lazy as _
from accounts.models import * from accounts.models import *
from admin.decorators import superuser_only from admin.decorators import superuser_only
from appsettings.models import AppSettings
from instances.models import Instance from instances.models import Instance
from . import forms from . import forms
@ -27,8 +25,8 @@ def profile(request):
if 'username' in request.POST: if 'username' in request.POST:
username = request.POST.get('username', '') username = request.POST.get('username', '')
email = request.POST.get('email', '') email = request.POST.get('email', '')
user.first_name = username request.user.first_name = username
user.email = email request.user.email = email
request.user.save() request.user.save()
return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path())
if 'keyname' in request.POST: if 'keyname' in request.POST: