def METHOD_NAME():
    email = request.form.get('username')
    role = request.form.get('user_role')
    password1 = request.form.get('password1')
    password2 = request.form.get('password2')
    all_roles = Users.get_all_roles()
    if email and len(email) < 300 and check_email(email) and role:
        if role in all_roles:
            # password set
            if password1 and password2:
                if password1 == password2:
                    if Users.check_password_strength(password1):
                        password = password1
                    else:
                        return render_template("create_user.html", all_roles=all_roles, error="Incorrect Password",
                                               admin_level=True)
                else:
                    return render_template("create_user.html", all_roles=all_roles, error="Passwords don't match",
                                           admin_level=True)
            # generate password
            else:
                password = Users.gen_password()
            if current_user.is_in_role('admin'):
                str_password = password
                if Users.exists_user(email):
                    if not password1 and not password2:
                        password = None
                        str_password = 'Password not changed'
                Users.create_user(email, password=password, role=role)
                return redirect(url_for('settings.users_list', new_user=email, new_user_password=str_password))
        else:
            return render_template("create_user.html", all_roles=all_roles, admin_level=True)
    else:
        return render_template("create_user.html", all_roles=all_roles, error_mail=True, admin_level=True)