Skip to content

Refactor form views#4077

Draft
JoeyStk wants to merge 11 commits intodevelopfrom
refactor-form-views
Draft

Refactor form views#4077
JoeyStk wants to merge 11 commits intodevelopfrom
refactor-form-views

Conversation

@JoeyStk
Copy link
Copy Markdown
Contributor

@JoeyStk JoeyStk commented Dec 21, 2025

Short description

This PR is based off of #3837 and can only be reviewed (properly) after the Django update is open :). During our work on the upgrade, we had to do a few changes to the poi_form_view and event_form_view. Those changes increased the complexity of the files (for poi_form_view it even made it necessary to disable a ruff rule). This PR attempts to fix these issues.

For an easier view to review this, this link might be helpful :)

--- Info ---
This PR was handed over to @MizukiTemma

Proposed changes

  • Reduce CC of event_form_view from 30 to 26
  • Reduce LOC of event_form_view from 201 to 177
  • Reduce CC of poi_form_view from 33 to 14
  • Reduce LOC of poi_form_view from 232 to 141
  • Reduce statements in poi_form_view, so that rule can be enabled again

Side effects

  • This refactoring is by no means "perfect", these were just a few low hanging fruits I wanted to collect for us.
  • Feel free to either extend this refactoring or refactor these files even more in the future
  • As with all refactorings, I tried my best to pay attention to all the details, but of course there is a high chance of human error, so horough testing is highly appreciated.

Faithfulness to issue description and design

There are no intended deviations from the issue and design.

How to test

  • All actions in event form and poi form :)

Resolved issues

Fixes: #4208


Pull Request Review Guidelines

@MizukiTemma MizukiTemma added the blocked Blocked by external dependency label Jan 26, 2026
@MizukiTemma
Copy link
Copy Markdown
Member

Waiting for #3837

@hannaseithe hannaseithe added this to the Next milestone Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked by external dependency

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor post in integreat_cms/cms/views/pois/poi_form_view.py

5 participants