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

Implemented backbone for review financial aid page #1071

Merged
merged 43 commits into from
Sep 21, 2016

Conversation

alvinsiu
Copy link
Contributor

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?

mirfark and others added 30 commits September 14, 2016 16:17
…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
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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

@noisecapella
Copy link
Contributor

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?

@odlbot odlbot temporarily deployed to micromasters-ci-pr-1071 September 21, 2016 15:18 Inactive
@alvinsiu
Copy link
Contributor Author

Changes requested have been updated, thanks!

@alvinsiu
Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 50

Copy link
Contributor Author

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>
Copy link
Contributor

@noisecapella noisecapella Sep 21, 2016

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

Copy link
Contributor Author

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

@noisecapella
Copy link
Contributor

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):
Copy link
Contributor

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']

Copy link
Contributor Author

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))
Copy link
Contributor

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

@noisecapella
Copy link
Contributor

Looks good 👍

@alvinsiu alvinsiu merged commit 35d7cc6 into master Sep 21, 2016
@giocalitri giocalitri deleted the zagaran/reviewfinancialaid branch September 21, 2016 20:50
@annagav annagav mentioned this pull request Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants