update vm build. use title for new lists not id, also make first user admin
This commit is contained in:
parent
956854d5bc
commit
0eeb3e223d
8 changed files with 35 additions and 29 deletions
|
|
@ -129,6 +129,9 @@ class UserProfile(models.Model):
|
|||
|
||||
def user_post_save(sender, instance, **kwargs):
|
||||
profile, new = UserProfile.objects.get_or_create(user=instance)
|
||||
if new and instance.is_superuser:
|
||||
profile.level = len(settings.CONFIG['userLevels']) - 1
|
||||
profile.save()
|
||||
SessionData.objects.filter(user=instance).update(level=profile.level,
|
||||
username=instance.username)
|
||||
models.signals.post_save.connect(user_post_save, sender=User)
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ def signup(request):
|
|||
user.save()
|
||||
#create default user lists:
|
||||
for l in settings.CONFIG['personalLists']:
|
||||
list = models.List(name=l['id'], user=user)
|
||||
list = models.List(name=l['title'], user=user)
|
||||
for key in ('query', 'public', 'featured'):
|
||||
if key in l:
|
||||
setattr(list, key, l[key])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue