Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace personal_email with email_address throughout #41

Merged
merged 1 commit into from Jun 7, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -56,7 +56,7 @@ class Candidate(db.Model):
applications = db.relationship('Application', backref='candidate', lazy='dynamic')

def __repr__(self):
return f'<Candidate email {self.personal_email}>'
return f'<Candidate email {self.email_address}>'

def current_grade(self):
return self.roles.order_by(Role.date_started.desc()).first().grade
@@ -39,7 +39,7 @@ def choose_update():
@route_blueprint.route('/update/search-candidate', methods=["POST", "GET"])
def search_candidate():
if request.method == "POST":
candidate = Candidate.query.filter_by(personal_email=request.form.get('candidate-email')).one_or_none()
candidate = Candidate.query.filter_by(email_address=request.form.get('candidate-email')).one_or_none()
if candidate:
session['candidate-id'] = candidate.id
else:
@@ -100,7 +100,7 @@ def check_your_answers():
)
new_email = session.get('new-email')
if new_email:
candidate.personal_email = new_email
candidate.email_address = new_email
db.session.add_all([candidate, new_role])
db.session.commit()

@@ -128,7 +128,7 @@ def human_readable_role(role_data: Dict):
return data
session['human-readable-new-role'] = human_readable_role(session['new-role'])
return render_template('updates/check-your-answers.html',
candidate_email=session.get('new-email', candidate.personal_email),
candidate_email=session.get('new-email', candidate.email_address),
role_data=session.get('human-readable-new-role'))


@@ -3,7 +3,7 @@
{% block content %}
{% for candidate in candidates %}
<h2 class="govuk-heading-l">
{{ candidate.personal_email }}
{{ candidate.email_address }}
</h2>
{% for role in candidate.roles.all() %}
<p>{{ role.organisation.name }}</p>
@@ -3,7 +3,7 @@
{% block content %}

<h2 class="govuk-heading-l">
Details of the new role for {{ candidate.personal_email }}
Details of the new role for {{ candidate.email_address }}
</h2>
<form class="form" action="" method="post">
<div class="govuk-form-group">
@@ -43,7 +43,7 @@ def test_candidate(test_database):
'grades': [Grade(value='Band A', rank=2), Grade(value='SCS3', rank=1)],
'test_candidates': [
Candidate(
personal_email='test.candidate@numberten.gov.uk',
email_address='test.candidate@numberten.gov.uk',
completed_fast_stream=True,
joining_date=date(2018, 5, 1),
joining_grade=1
@@ -47,7 +47,7 @@ def generate_random_fixed_data():

def generate_known_candidate():
return Candidate(
personal_email="staging.candidate@gov.uk", joining_date=date(2015, 9, 1),
email_address="staging.candidate@gov.uk", joining_date=date(2015, 9, 1),
completed_fast_stream=True,
joining_grade=Grade.query.filter(Grade.value.like("%Faststream%")).first().id,
roles=[Role(date_started=date(2015, 9, 2), temporary_promotion=False,
@@ -58,7 +58,7 @@ def generate_known_candidate():


def generate_random_candidate():
return Candidate(personal_email=f"{random_string(16)}@gov.uk",
return Candidate(email_address=f"{random_string(16)}@gov.uk",
joining_date=date(random.randrange(1960, 2018), random.randrange(1, 12), random.randrange(1, 28)),
completed_fast_stream=random.choice([True, False]),
joining_grade=(Grade.query.filter_by(rank=6).first()).id
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.