-
Notifications
You must be signed in to change notification settings - Fork 39
Fix batch determination different forms issue #4304
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
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: hypha/apply/determinations/views.py
Did you find this useful? React with a 👍 or 👎 |
| ) | ||
| if redirect: | ||
| return HttpResponseClientRedirect(redirect.url) | ||
| # should redirect |
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.
Moved should_redirect method directly in here to avoid raising an Error, instead showing the error to the user without performing the batch action.
It is hard to find all the cases at once so I guess it is a better way to avoid 500. We can include the cases to validation as soon as it is reported.
This comment was marked as outdated.
This comment was marked as outdated.
d5ea79a to
5743656
Compare
hypha/apply/funds/views/partials.py
Outdated
|
|
||
| # hide determination actions if submissions have different forms | ||
| if not allow_determination: | ||
| determination_actions = ["Dismiss", "Request More Information", "Accept"] |
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.
@sandeepsajan0 Will this work with translations?
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.
@frjo It is fixed now, used machine names(DETERMINATION_OUTCOMES) to compare.
|
In testing this definitely was a lot smoother! @sandeepsajan0 I noticed when I selected a couple of lab submissions they all gave me the option to bulk dismiss, and the same with when I selected fund submissions, but combining them removed that option - is this because of the difference in determination forms? if so I think this is ready |
74bd050 to
44febe5
Compare
@wes-otf Yes, determination actions are not available for different forms now. Because for determination we need to render determination form and it is impossible to render different form for a single bulk action. |
hypha/apply/funds/utils.py
Outdated
| determination_form_ids = [ | ||
| submission.get_from_parent("determination_forms").first().id | ||
| for submission in submissions | ||
| ] |
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.
There is an edge case where no determination form id exist. I believe this only affects OTF that still have some funds/labs that use the old hardcoded determination forms, before we made them into stream field forms.
Unsure how to best solve this issue without messing up the code more than needed.
@wes I assume all current funds and labs by OTF uses streamfield determination forms, can you confirm that?
We have a property to check if a submission use the old forms, see:
hypha/hypha/apply/funds/models/submissions.py
Lines 603 to 614 in 44febe5
| @property | |
| def is_determination_form_attached(self): | |
| """ | |
| We use old django determination forms but now as we are moving | |
| to streamfield determination forms which can be created and attached | |
| to funds in admin. | |
| This method checks if there are new determination forms attached to the | |
| submission or we would still use the old determination forms for backward | |
| compatibility. | |
| """ | |
| return self.get_from_parent("determination_forms").count() > 0 |
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.
did a quick pass today and it doesn't seem like any of OTFs funds still use it actively. would still probably be worth it to handle it so it doesn't error out if there's an archive fund or something weird down the road. even if that's just ignoring it
frjo
left a comment
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.
Works well in my testing.
Fixes #4290
Test Steps