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

Fix Multi Report recursion error #3714

Merged
merged 8 commits into from
Oct 30, 2024
Merged

Conversation

Rieven
Copy link
Contributor

@Rieven Rieven commented Oct 22, 2024

Changes

Issue link

#3623

Closes #3623

Demo

image

QA notes

The last step will give you a 405 error as this last flow must be refactored see the refactor branch.


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

@Rieven Rieven requested a review from a team as a code owner October 22, 2024 10:01
@@ -63,11 +62,6 @@ class OOISelectionMultiReportView(MultiReportStepsMixin, BreadcrumbsMultiReportV
current_step = 1
ooi_types = MultiOrganizationReport.input_ooi_types

def get(self, request, *args, **kwargs):
Copy link
Contributor Author

@Rieven Rieven Oct 22, 2024

Choose a reason for hiding this comment

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

Removed all get from MultiReport views as we use now post requests.

messages.error(request, self.NONE_OOI_SELECTION_MESSAGE)
return redirect(self.get_previous())
return self.get(request, *args, **kwargs)
ooi_types = MultiOrganizationReport.input_ooi_types
Copy link
Contributor Author

@Rieven Rieven Oct 22, 2024

Choose a reason for hiding this comment

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

ooi_types must be present otherwise when selecting all oois it will fetch all ooi types. We want specific ooi types stored in the report types. I have refactor this part in #3705 which is done more efficiently in a get function.

@@ -314,7 +314,7 @@ def get_context_data(self, **kwargs):
return context


class ReportTypeSelectionView(BaseReportView, ReportBreadcrumbs, TemplateView):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TemplateView is removed, it clashes with ListView from the BaseOOILIst. use it in specific views where needed.

@noamblitz
Copy link
Contributor

noamblitz commented Oct 22, 2024

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

No more RecursionError

What doesn't work:

Cant generate multi-report. Will test other PR now.

Copy link

sonarcloud bot commented Oct 30, 2024

@underdarknl underdarknl merged commit 12c5788 into main Oct 30, 2024
22 checks passed
@underdarknl underdarknl deleted the fix/multi-report-recurrsion branch October 30, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

RecursionError at /en/dev/reports/multi-report/select/oois/
4 participants