Skip to content

Commit 394dab6

Browse files
authored
#253 Bugfix: 500 Error on Hackadmin page (#258)
* Pull changes from upstream and update * Initial commit on bug-fix #253 branch * Fix Bug#253
1 parent eab24ee commit 394dab6

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

hackadmin/helpers.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,17 @@ def extract_badges_for_hackathon(hackathon, issue_date, format='json'):
6363

6464
badges.setdefault('facilitators', [])
6565
for team in hackathon.teams.all():
66-
badges['facilitators'].append({
67-
'first_name': team.mentor.first_name,
68-
'name': team.mentor.full_name or team.mentor.slack_display_name,
69-
'email': team.mentor.email,
70-
'issue_date': issue_date,
71-
'team': team.display_name,
72-
'project': team.project.display_name if team.project else '',
73-
'award': 'Hackathon Facilitators',
74-
'award_ranking': 'n/a',
75-
})
66+
if team.mentor:
67+
badges['facilitators'].append({
68+
'first_name': team.mentor.first_name,
69+
'name': team.mentor.full_name or team.mentor.slack_display_name,
70+
'email': team.mentor.email,
71+
'issue_date': issue_date,
72+
'team': team.display_name,
73+
'project': team.project.display_name if team.project else '',
74+
'award': 'Hackathon Facilitators',
75+
'award_ranking': 'n/a',
76+
})
7677

7778
projects = [team.project for team in hackathon.teams.all()
7879
if team.project]

hackadmin/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def hackathon_participants(request, hackathon_id):
5252
hackathon, date.today().isoformat()).items()
5353
for awardee in values
5454
if category not in ['participants', 'judges', 'facilitators']]
55-
print(awardees)
5655
return render(request, 'hackadmin_participants.html', {
5756
'hackathon': hackathon,
5857
'mentors': mentors,

0 commit comments

Comments
 (0)