-
Notifications
You must be signed in to change notification settings - Fork 17
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
Implemented backbone for review financial aid page #1071
Conversation
…or getting available tiers on financial review page
View for reviewing financial aid requests. | ||
Note: In the future, it may be worth factoring out the code for sorting into its own subclass of ListView | ||
""" | ||
paginate_by = 10 |
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.
Can you change this to 50 per @roberthouse54's request?
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.
Ah, I didn't see this request. Done
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.
It's just an informal request he made to me a few minutes ago
When the user goes to the next page all sorting is removed. Can we preserve the other query parameters when going back and forth between pages? |
Changes requested have been updated, thanks! |
Note: financialaid/views.py line 95 (# pylint: disable=unsubscriptable-object) is necessary because of a bug in django pylint. pylint-dev/pylint-django#67 |
@@ -48,7 +48,7 @@ class ReviewFinancialAidView(UserPassesTestMixin, ListView): | |||
View for reviewing financial aid requests. | |||
Note: In the future, it may be worth factoring out the code for sorting into its own subclass of ListView | |||
""" | |||
paginate_by = 10 | |||
paginate_by = 2 |
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.
This should be 50
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.
Ah, I changed it to 50, then to 2 to test sorting with pagination, then forgot to change it back. Thanks!
< | ||
</a> | ||
{% else %} | ||
<button class="btn btn-default disabled"><</button> |
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.
Please change >
to an html entity, here and below
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.
Ah missed these two, thanks
Functionality looks great! I still need to go over the tests to make sure everything is covered but otherwise the code is in good shape, except the two comments I just made |
resp = self.client.get(self.review_url) | ||
assert resp.status_code == status.HTTP_200_OK | ||
|
||
def test_review_financial_aid_view_with_filter_and_sorting(self): |
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.
Can we test that the sorting and filtering is reflected in the queryset? The queryset output looks to be available in resp.context_data['object_list']
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've added those tests
tier_program__program_id=self.program.id, | ||
status=FinancialAidStatus.AUTO_APPROVED | ||
).order_by("user__profile__first_name").values_list("id", flat=True) # Default sort field | ||
self.assertListEqual(list(resp_obj_id_list), list(expected_obj_id_list)) |
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.
assert
should work here too but feel free to leave it
Looks good 👍 |
What are the relevant tickets?
#1045
What's this PR do?
Implements the backbone template and view for reviewing financial aid applications. This PR does not implement any of the functionality from the page (aside from pagination and sorting).
Where should the reviewer start?
How should this be manually tested?
Any background context you want to provide?
Screenshots (if appropriate)
What GIF best describes this PR or how it makes you feel?