def METHOD_NAME(self):
    name = request.form['username']
    password = request.form['password1']
    password_retype = request.form['password2']
    if self._user_db_interface.user_exists(name):
        flash('Error: user is already in the database', 'danger')
    elif password != password_retype:
        flash('Error: passwords do not match', 'danger')
    else:
        with self.user_db_session('Error while creating user'):
            self._user_db_interface.create_user(email=name, password=hash_password(password))
            flash('Successfully created user', 'success')
            logging.info(f'Created user: {name}')