forked from HackFSU/hackfsu-2018
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .by_school import BySchoolCsv | ||
from .by_school import BySchoolCsv | ||
from .resume_links import ResumeLinksCsv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
""" | ||
Generates a CSV containing approved hackers' resumes | ||
""" | ||
|
||
from hackfsu_com.views.generic import StreamedCsvView | ||
from hackfsu_com.util import acl, files | ||
from django.conf import settings | ||
from api.models import Hackathon, HackerInfo | ||
|
||
|
||
class ResumeLinksCsv(StreamedCsvView): | ||
access_manager = acl.AccessManager(acl_accept=[acl.group_organizer]) | ||
file_name = 'HackFSU Approved Hackers\' Submitted Resumes.csv' | ||
|
||
@staticmethod | ||
def row_generator(request): | ||
h = Hackathon.objects.current() | ||
yield ['Approved Hackers\' Submitted Resumes'] | ||
yield [ | ||
'First Name', | ||
'Last Name', | ||
'Email', | ||
'School', | ||
'Attended', | ||
'Resume File Name', | ||
'Resume URL' | ||
] | ||
|
||
for hacker in HackerInfo.objects.filter( | ||
hackathon=h, | ||
approved=True | ||
): | ||
row = [ | ||
hacker.user.first_name, | ||
hacker.user.last_name, | ||
hacker.user.email, | ||
str(hacker.school), | ||
hacker.attendee_status.checked_in_at is not None | ||
] | ||
|
||
if len(hacker.resume_file_name) > 0: | ||
row.extend([ | ||
hacker.resume_file_name.split('/')[-1], | ||
settings.URL_BASE + files.get_url(hacker.resume_file_name) | ||
]) | ||
|
||
yield row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters