mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Move and rename macro.html
Remove print statements Fix code style
This commit is contained in:
@@ -89,11 +89,7 @@ class AddServiceForm(Form):
|
||||
service_name = StringField(validators=[DataRequired(message='Please enter your service name')])
|
||||
|
||||
def validate_service_name(self, a):
|
||||
print("a {}".format(a))
|
||||
print("self.service_name {}".format(self.service_name.data))
|
||||
print("service_names {}".format(self.service_names))
|
||||
if self.service_name.data in self.service_names:
|
||||
print('here')
|
||||
raise ValidationError('Service name already exists')
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ from app.main.forms import AddServiceForm
|
||||
@login_required
|
||||
def add_service():
|
||||
form = AddServiceForm(services_dao.find_all_service_names())
|
||||
print("serivce_names {}".format(services_dao.find_all_service_names()))
|
||||
if form.validate_on_submit():
|
||||
|
||||
user = users_dao.get_user_by_id(session['user_id'])
|
||||
@@ -17,4 +16,3 @@ def add_service():
|
||||
return redirect('/dashboard')
|
||||
else:
|
||||
return render_template('views/add-service.html', form=form)
|
||||
§
|
||||
@@ -1,4 +1,4 @@
|
||||
{%- from "macros.html" import render_field %}
|
||||
{%- from "components/form-field.html" import render_field %}
|
||||
{% block top_of_page %}{% endblock %}
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 9]><html class="lte-ie8" lang="{{ html_lang|default('en') }}"><![endif]-->
|
||||
|
||||
@@ -71,4 +71,3 @@ def test_should_return_list_of_service_names(notifications_admin, notifications_
|
||||
|
||||
actual = services_dao.find_all_service_names()
|
||||
assert actual == expected
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ def test_should_login_user_when_multiple_valid_codes_exist(notifications_admin,
|
||||
response = client.post('/two-factor',
|
||||
data={'sms_code': '23456'})
|
||||
assert response.status_code == 302
|
||||
print(user.id)
|
||||
codes = verify_codes_dao.get_codes(user_id=user.id, code_type='sms')
|
||||
# query will only return codes where code_used == False
|
||||
assert len(codes) == 0
|
||||
|
||||
Reference in New Issue
Block a user