diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/public/views.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/public/views.py index bf14a6f..875920e 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/public/views.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/public/views.py @@ -51,13 +51,10 @@ def register(): email=form.email.data, password=form.password.data, active=True) - try: - db.session.add(new_user) - db.session.commit() - flash("Thank you for registering. You can now log in.", 'success') - return redirect(url_for('public.home')) - except IntegrityError as err: - flash("That username and/or email already exists. Try again.", 'warning') + db.session.add(new_user) + db.session.commit() + flash("Thank you for registering. You can now log in.", 'success') + return redirect(url_for('public.home')) else: flash_errors(form) return render_template('public/register.html', form=form)