diff options
Diffstat (limited to 'yaksh/management/commands')
-rw-r--r-- | yaksh/management/commands/create_moderator.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/yaksh/management/commands/create_moderator.py b/yaksh/management/commands/create_moderator.py index 3ec012e..c0f160a 100644 --- a/yaksh/management/commands/create_moderator.py +++ b/yaksh/management/commands/create_moderator.py @@ -10,6 +10,7 @@ from django.contrib.auth.models import User, Group, Permission # local imports from yaksh.models import create_group +from yaksh.views import _create_or_update_profile class Command(BaseCommand): @@ -43,6 +44,10 @@ class Command(BaseCommand): ) ) else: + if not hasattr(user, 'profile'): + _create_or_update_profile(user, + {'is_email_verified': True} + ) user.profile.is_moderator = True user.profile.save() self.stdout.write( |