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

[#4397] Add query parameter to pass reference to existing object in the Objects API #4521

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Jul 12, 2024

Closes #4397

Changes

  • Added object_reference to the Submission model in order to save the reference we get from the frontend.
    This will be used to retrieve further information for the real object

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 July 12, 2024 11:45
@vaszig vaszig force-pushed the task/4397-add-query-param-objectReference-to-the-create-submission branch from 399c345 to 43451be Compare July 12, 2024 12:03
Copy link

codecov bot commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.57%. Comparing base (edf1df2) to head (c83cfb8).
Report is 503 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4521   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files         719      719           
  Lines       24065    24077   +12     
  Branches     2860     2862    +2     
=======================================
+ Hits        23241    23253   +12     
  Misses        560      560           
  Partials      264      264           

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

@vaszig vaszig force-pushed the task/4397-add-query-param-objectReference-to-the-create-submission branch 2 times, most recently from 52f5cad to 0720c04 Compare July 12, 2024 12:14
@vaszig vaszig marked this pull request as ready for review July 12, 2024 12:41
@Viicos Viicos self-requested a review July 12, 2024 13:04
src/openforms/submissions/api/serializers.py Outdated Show resolved Hide resolved
src/openforms/submissions/models/submission.py Outdated Show resolved Hide resolved
@vaszig vaszig force-pushed the task/4397-add-query-param-objectReference-to-the-create-submission branch from 0720c04 to cfe3771 Compare July 15, 2024 10:34
@vaszig vaszig force-pushed the task/4397-add-query-param-objectReference-to-the-create-submission branch 2 times, most recently from df4b7a3 to 600aae2 Compare July 15, 2024 12:19
src/openforms/submissions/admin.py Outdated Show resolved Hide resolved
src/openforms/submissions/admin.py Outdated Show resolved Hide resolved
src/openforms/submissions/models/submission.py Outdated Show resolved Hide resolved
@vaszig vaszig force-pushed the task/4397-add-query-param-objectReference-to-the-create-submission branch from 600aae2 to 32ad9fb Compare July 17, 2024 08:07
This is done in order to save the initial data reference which comes from the frontend
as a query parameter. It will be used to retreive additional information for
the object from the Objects API (we are going to support only this for now)
@vaszig vaszig force-pushed the task/4397-add-query-param-objectReference-to-the-create-submission branch from 32ad9fb to c83cfb8 Compare July 17, 2024 08:21
@vaszig vaszig requested a review from sergei-maertens July 17, 2024 14:12
Comment on lines +247 to +249
self.assertEqual(
submission.initial_data_reference, body["initialDataReference"]
)
Copy link
Member

@sergei-maertens sergei-maertens Jul 17, 2024

Choose a reason for hiding this comment

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

in tests, please make assertions with the literal values instead of referring to variables in tests, that makes it clear what is being compared to what.

so do this instead:

self.assertEqual(submission.initial_data_reference, "of-or-3452fre3")

@sergei-maertens sergei-maertens merged commit 191b435 into master Jul 17, 2024
32 checks passed
@sergei-maertens sergei-maertens deleted the task/4397-add-query-param-objectReference-to-the-create-submission branch July 17, 2024 15:34
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.

Add query parameter to pass reference to existing object and send this to the backend on submissionCreate
3 participants