update vm build. use title for new lists not id, also make first user admin

This commit is contained in:
j 2011-11-08 18:05:26 +01:00
commit 0eeb3e223d
8 changed files with 35 additions and 29 deletions

View file

@ -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)