annotation cleanup

This commit is contained in:
j 2011-12-26 20:00:30 +05:30
commit 6524ceea8a
7 changed files with 27 additions and 45 deletions

View file

@ -187,6 +187,7 @@ 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.newsletter = settings.CONFIG['user']['newsletter']
profile.save()
SessionData.objects.filter(user=instance).update(level=profile.level,
username=instance.username)