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
Implement exporting of all company interest data to a csv file #3231
Conversation
5f5e80e
to
bbd0302
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 💯
Would be nice with a test checking the permissions of the user requesting, although it looks fine.
3778e13
to
19d4089
Compare
_get_export_company_interest() | ||
) | ||
self.assertEqual( | ||
company_interest_export_responce.status_code, status.HTTP_403_FORBIDDEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should test for both cases, so a 200 response as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't manage to find out how make a request in the reverse() function that includes the query parameters "year" and "semester". Could you give me some tips.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can make a new reverse function for that, but you shouldn't need to. The reverse function is based on what is defined in the urls, but to send a valid response you only need to manipulate the query params (from the view).
If you take the reverse url you have already used and append "?year=2023&semester=whatnot", from a Bedkom-user you should get a valid response.
You have some discussions of different ways to do it here https://stackoverflow.com/questions/4995279/including-a-querystring-in-a-django-core-urlresolvers-reverse-call
Also, use multi line commit messages where you describe your change if you're gonna do a "small fixes". |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3231 +/- ##
==========================================
+ Coverage 88.31% 88.34% +0.02%
==========================================
Files 659 659
Lines 20770 20829 +59
==========================================
+ Hits 18344 18401 +57
- Misses 2426 2428 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small knitpicking
_get_export_company_interest() | ||
) | ||
self.assertEqual( | ||
company_interest_export_responce.status_code, status.HTTP_403_FORBIDDEN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can make a new reverse function for that, but you shouldn't need to. The reverse function is based on what is defined in the urls, but to send a valid response you only need to manipulate the query params (from the view).
If you take the reverse url you have already used and append "?year=2023&semester=whatnot", from a Bedkom-user you should get a valid response.
You have some discussions of different ways to do it here https://stackoverflow.com/questions/4995279/including-a-querystring-in-a-django-core-urlresolvers-reverse-call
84a9524
to
fa352db
Compare
Wrote tests that check the permissions of the user requesting and other small fixes as requested in the pr conversations
fa352db
to
800b71c
Compare
Implement exporting of all company interest data to a csv file as requested by Intercom. The query will specify which answers to export. The answers are exported by the semester they are registered in and the type of event they are related to.