Exemple #1
0
def  createAdmin(email,password,name):
        ''' Create an admin from the given email and password'''
        mlogger.debug("Creating admin email = %s " %(email,))    
        u = User.objects.create_user(email.replace("@","_").replace(".","_"),email)
        u.set_password(password)
        u.save()        
        #he is admin save his profile
        up = UserProfile()
        up.country = Country.objects.all()[0]
        up.isadmin = True
        up.fullname = name
        up.user = u
        up.save()
        incorporateEmailActivation(up)
        return u