mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
using custom accounts.backends.MyRemoteUserBackend, which adds default instances and attributes for user
create_missing_userattributes removed from accounts view
This commit is contained in:
parent
609651d707
commit
fe89af9d8f
3 changed files with 26 additions and 13 deletions
|
|
@ -70,21 +70,11 @@ def accounts(request):
|
|||
:param request:
|
||||
:return:
|
||||
"""
|
||||
|
||||
def create_missing_userattributes(users):
|
||||
for user in users:
|
||||
try:
|
||||
userattributes = user.userattributes
|
||||
except UserAttributes.DoesNotExist:
|
||||
userattributes = UserAttributes(user=user)
|
||||
userattributes.save()
|
||||
|
||||
if not request.user.is_superuser:
|
||||
return HttpResponseRedirect(reverse('index'))
|
||||
|
||||
error_messages = []
|
||||
users = User.objects.all().order_by('username')
|
||||
create_missing_userattributes(users)
|
||||
allow_empty_password = settings.ALLOW_EMPTY_PASSWORD
|
||||
|
||||
if request.method == 'POST':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue