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

[#4321] Allow max number of submissions per form #4885

Merged

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Dec 3, 2024

Closes #4321 partly

Changes

  • Added fields to Form model in order to track max submissions and the counter
  • New tab on the admin page of the form for setting max allowed submissions

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@vaszig vaszig marked this pull request as draft December 3, 2024 16:01
@vaszig vaszig closed this Dec 5, 2024
@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch from c23efc9 to 0bda3f3 Compare December 5, 2024 09:58
@vaszig vaszig reopened this Dec 5, 2024
@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch from a7718b3 to cbf9ee9 Compare December 6, 2024 12:02
@vaszig vaszig marked this pull request as ready for review December 6, 2024 12:15
@vaszig vaszig marked this pull request as draft December 6, 2024 12:18
@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch from cbf9ee9 to d9d0005 Compare December 6, 2024 12:38
@vaszig vaszig marked this pull request as ready for review December 6, 2024 13:03
@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch from d9d0005 to 77c5a24 Compare December 11, 2024 06:36
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.58%. Comparing base (3ae753c) to head (a21cc64).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
src/openforms/submissions/utils.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4885   +/-   ##
=======================================
  Coverage   96.57%   96.58%           
=======================================
  Files         757      757           
  Lines       25728    25783   +55     
  Branches     3379     3390   +11     
=======================================
+ Hits        24847    24902   +55     
  Misses        616      616           
  Partials      265      265           

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

@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch from 77c5a24 to e7e6d5a Compare December 11, 2024 06:55
@vaszig vaszig requested a review from robinmolen December 11, 2024 12:49
@sergei-maertens sergei-maertens force-pushed the feature/4321-allow-maximum-number-of-submissions branch from e7e6d5a to 4081f20 Compare December 11, 2024 17:06
src/openforms/forms/admin/form.py Outdated Show resolved Hide resolved
src/openforms/forms/admin/form.py Outdated Show resolved Hide resolved
src/openforms/forms/admin/form.py Show resolved Hide resolved
src/openforms/forms/api/serializers/form.py Outdated Show resolved Hide resolved
src/openforms/forms/api/serializers/form.py Outdated Show resolved Hide resolved
src/openforms/js/utils/fetch.js Outdated Show resolved Hide resolved
src/openforms/submissions/exceptions.py Outdated Show resolved Hide resolved
src/openforms/submissions/exceptions.py Outdated Show resolved Hide resolved
src/openforms/submissions/signals.py Outdated Show resolved Hide resolved
@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch 2 times, most recently from 9270ede to f1815ad Compare December 12, 2024 15:11
src/openforms/forms/admin/form.py Show resolved Hide resolved
src/openforms/forms/api/serializers/form.py Outdated Show resolved Hide resolved
@@ -485,6 +517,7 @@ def copy(self):
)
copy.slug = _("{slug}-copy").format(slug=self.slug)
copy.product = self.product
copy.submission_counter = 0
Copy link
Member

Choose a reason for hiding this comment

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

yes :)

src/openforms/forms/tests/test_serializers.py Outdated Show resolved Hide resolved
src/openforms/submissions/signals.py Show resolved Hide resolved
src/openforms/submissions/tests/test_resume_form_view.py Outdated Show resolved Hide resolved
@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch from f1815ad to ea488a3 Compare December 13, 2024 13:31
@vaszig
Copy link
Contributor Author

vaszig commented Dec 13, 2024

I do not know why test coverage doesn't like the src/openforms/submissions/utils.py#L306 but these lines are covered both for starting and resuming a form.

@vaszig vaszig force-pushed the feature/4321-allow-maximum-number-of-submissions branch from ea488a3 to a21cc64 Compare December 13, 2024 14:26
@sergei-maertens sergei-maertens merged commit 753691c into master Dec 13, 2024
32 of 34 checks passed
@sergei-maertens sergei-maertens deleted the feature/4321-allow-maximum-number-of-submissions branch December 13, 2024 15:43
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.

Als formulier editor wil ik een maximum aantal inzendingen toestaan.
2 participants