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

[#2753] Make contact form configurable via CMS #1402

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

pi-sigma
Copy link
Contributor

@pi-sigma pi-sigma force-pushed the task/2753-contactformulier-cms branch 3 times, most recently from 4a36e77 to 928328b Compare September 24, 2024 12:52
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.89%. Comparing base (f0aedc1) to head (445977a).
Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1402   +/-   ##
========================================
  Coverage    94.89%   94.89%           
========================================
  Files         1046     1049    +3     
  Lines        38612    38655   +43     
========================================
+ Hits         36640    36682   +42     
- Misses        1972     1973    +1     
Flag Coverage Δ
94.89% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi-sigma pi-sigma requested a review from swrichards September 24, 2024 13:56
@pi-sigma pi-sigma marked this pull request as ready for review September 24, 2024 13:56
Copy link
Collaborator

@swrichards swrichards left a comment

Choose a reason for hiding this comment

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

Just a few small things: it's clear a few hoops had to be jumped through, but I don't have any better ideas, so this approach LGTM.

src/open_inwoner/openklant/tests/test_contactform.py Outdated Show resolved Hide resolved
src/open_inwoner/urls.py Show resolved Hide resolved
src/open_inwoner/openklant/views/contactform.py Outdated Show resolved Hide resolved
src/open_inwoner/openklant/forms.py Outdated Show resolved Hide resolved
@pi-sigma pi-sigma marked this pull request as draft September 25, 2024 14:06
@pi-sigma pi-sigma force-pushed the task/2753-contactformulier-cms branch 2 times, most recently from 1aeddbc to 9a2a8ab Compare September 27, 2024 13:00
@pi-sigma
Copy link
Contributor Author

@swrichards messages are not being cleared between subtests in test_submit_and_register_kvk_or_rsin_user_via_api. I've tried various things to no avail; somehow the combination of subtests and requests_mock prevents manual clearing of messages in the test. I am now clearing messages in set_result_message of the ContactFormView. This is not optimal, since the problem is with our test, not with the business logic (at least that's my suspicion, since the frontend shows only one message; on the other hand, the problem only occurred after introducing the CMS plugin). If you have ideas about this, let me know.

@pi-sigma pi-sigma marked this pull request as ready for review September 27, 2024 14:43
@pi-sigma pi-sigma requested a review from swrichards September 27, 2024 14:44
@pi-sigma pi-sigma force-pushed the task/2753-contactformulier-cms branch from 9a2a8ab to 445977a Compare September 30, 2024 08:51
@swrichards
Copy link
Collaborator

@swrichards messages are not being cleared between subtests in test_submit_and_register_kvk_or_rsin_user_via_api. I've tried various things to no avail; somehow the combination of subtests and requests_mock prevents manual clearing of messages in the test. I am now clearing messages in set_result_message of the ContactFormView. This is not optimal, since the problem is with our test, not with the business logic (at least that's my suspicion, since the frontend shows only one message; on the other hand, the problem only occurred after introducing the CMS plugin). If you have ideas about this, let me know.

As discussed off-line: clearing the cookiejar on the app object appears to solve this issue.

@swrichards swrichards closed this Sep 30, 2024
@pi-sigma pi-sigma reopened this Sep 30, 2024
@alextreme alextreme merged commit 1ce73db into develop Oct 2, 2024
39 checks passed
@alextreme alextreme deleted the task/2753-contactformulier-cms branch October 2, 2024 12:24
@alextreme
Copy link
Member

This PR doesn't tackle what I also wanted, namely a general plugin for content so that we can phase out flatpages in favor of using CMS Pages. But it was out-of-scope for the user story

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.

4 participants