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

Forward the request when saving the form #499

Merged
merged 1 commit into from
Oct 13, 2022

Conversation

felippem
Copy link
Contributor

Hello. I would like to forward the request to the instance of ConstanceForm, when calling the save method. Help me understand if it is necessary to update any tests.

@felippem
Copy link
Contributor Author

@Mogost @jezdez @Mogost Can you please review this?

@jezdez
Copy link
Member

jezdez commented Sep 21, 2022

@felippem Yes, the tests need to be updated, but I'm also curious for the use case?

@codecov
Copy link

codecov bot commented Sep 21, 2022

Codecov Report

Merging #499 (edbf1e3) into master (02c5fd5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #499   +/-   ##
=======================================
  Coverage   83.16%   83.16%           
=======================================
  Files          16       16           
  Lines         600      600           
  Branches      120      120           
=======================================
  Hits          499      499           
  Misses         67       67           
  Partials       34       34           
Impacted Files Coverage Δ
constance/admin.py 88.50% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@felippem
Copy link
Contributor Author

@felippem Yes, the tests need to be updated, but I'm also curious for the use case?

@jezdez I'd like to get the request.user.has_perm when the form loads, after it's posted. I have a custom form, which inherits Constance's original implementation.

@felippem
Copy link
Contributor Author

@felippem Yes, the tests need to be updated, but I'm also curious for the use case?

@jezdez I'd like to get the request.user.has_perm when the form loads, after it's posted. I have a custom form, which inherits Constance's original implementation.

Hi @jezdez ! Did you understand my use case?

@jezdez
Copy link
Member

jezdez commented Oct 3, 2022

@felippem I get it now, but this is actually a regression, since there is a permission check in the ConstanceForm.__init__ method that is currently not run for POST requests since the request isn't passed. Since the tests don't fail, it seems as if this line of code isn't accurately tested. Please add/update a test case for this.

@jezdez
Copy link
Member

jezdez commented Oct 3, 2022

This was an oversight in #393.

@felippem
Copy link
Contributor Author

felippem commented Oct 7, 2022

@felippem I get it now, but this is actually a regression, since there is a permission check in the ConstanceForm.__init__ method that is currently not run for POST requests since the request isn't passed. Since the tests don't fail, it seems as if this line of code isn't accurately tested. Please add/update a test case for this.

So I'll try to do that soon. Thanks for answering.

@felippem
Copy link
Contributor Author

felippem commented Oct 8, 2022

@felippem I get it now, but this is actually a regression, since there is a permission check in the ConstanceForm.__init__ method that is currently not run for POST requests since the request isn't passed. Since the tests don't fail, it seems as if this line of code isn't accurately tested. Please add/update a test case for this.

So I'll try to do that soon. Thanks for answering.

@jezdez Done. Can you review please?

@felippem felippem requested a review from Mogost October 8, 2022 05:01
Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

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

Thanks @felippem, this looks good to me. Would you mind adding an item to docs/changes.rst to note the regression fix?

docs/changes.rst Outdated Show resolved Hide resolved
docs/changes.rst Outdated Show resolved Hide resolved
docs/changes.rst Outdated Show resolved Hide resolved
docs/changes.rst Outdated Show resolved Hide resolved
@felippem felippem requested review from jezdez and removed request for Mogost October 9, 2022 20:39
@felippem
Copy link
Contributor Author

felippem commented Oct 9, 2022

Thank you @jezdez. Have an idea about the next release?

@camilonova camilonova merged commit b7da814 into jazzband:master Oct 13, 2022
@camilonova
Copy link
Member

Thank you

@felippem
Copy link
Contributor Author

Hi, @camilonova! Do you have a date for the next release?

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