def _require_user(username, fullname, password=None, is_superuser=False, email=None, alt_src_lang=None):
 from accounts.utils import verify_user
 from django.contrib.auth import get_user_model
 User = get_user_model()
 criteria = {'username': username, 'full_name': fullname, 'is_active': True, 'is_superuser': is_superuser}
 (user, created) = User.objects.get_or_create(**criteria)
 if created:
  if (password is None):
   user.set_unusable_password()
  else:
   user.set_password(password)
  if email:
   user.email = email
  user.save()
  if email:
   verify_user(user)
 if (alt_src_lang is not None):
  user.alt_src_langs.add(alt_src_lang())
 return user

def _require_user ( username , fullname , password = None , is_superuser = False , email = None , alt_src_lang = None ) : from accounts . utils import verify_user from django . contrib . auth import get_user_model User = get_user_model ( ) criteria = { 'username' : username , 'full_name' : fullname , 'is_active' : True , 'is_superuser' : is_superuser } ( user , created ) = User . objects . get_or_create ( ** criteria ) if created : if ( password is None ) : user . set_unusable_password ( ) else : user . set_password ( password ) if email : user . email = email user . save ( ) if email : verify_user ( user ) if ( alt_src_lang is not None ) : user . alt_src_langs . add ( alt_src_lang ( ) ) return user
helper to get/create a new user .