Add decorator and mixin for requiring consent decisions
Review Request #9948 — Created May 15, 2018 and submitted
We now provide a view decorator (
@check_pending_consent
) and a view
mixin (CheckPendingConsentMixin
) for requiring all consent decisions
to be made. If said decisions are not all made, the user will be
redirected to the URL specified in the
DJBLETS_PRIVACY_PENDING_CONSENT_REDIRECT_URL
setting.
Ran unit tests.
Description | From | Last Updated |
---|---|---|
F401 'djblets.cache.backend.make_cache_key' imported but unused |
reviewbot | |
Too many blank lines. |
david | |
Doc comment and superclass say returns but this doesn't have a return statement. |
david | |
n before r |
david | |
t before v |
david | |
t before v |
david | |
This example is a little confusing. We have a class called SimpleForm which is actually a view, and then we … |
david | |
Alphabetical order. |
chipx86 | |
:setting: isn't a thing. There's no reference or role for settings. For now, just do settings.BLAH. |
chipx86 | |
This should prefix settings. to add some context. |
chipx86 | |
We should allow this to be a function, since the URL may very well depend on the request. |
chipx86 | |
Too many blank lines. Same comment about :setting:. |
chipx86 | |
This should be one line. Why are we even taking request? Seems unnecessary. The decorator will still get it. |
chipx86 | |
This should just use record_consent_data_list(), and then there's no need to pull request.user out into user (we'll only access it … |
chipx86 | |
Should be: ``settings.DJBLETS_PRIVACY_CONSENT_TRACKER`` |
chipx86 | |
Let's add an anchor here. |
chipx86 | |
Same. |
chipx86 | |
Feels like this is too complex an example. It looks like a form is required here. Let's keep it as … |
chipx86 | |
These aren't valid responses for a view. |
chipx86 | |
The extra blank line can go away. |
chipx86 | |
E126 continuation line over-indented for hanging indent |
reviewbot | |
Doesn't this redirect to settings.DJBLETS_PRIVACY_PENDING_CONSENT_REDIRECT_URL? That said, I'd actually be OK calling it PENDING_CONSENT_REDIRECT_URL everywhere :) |
david | |
This should no longer be in "Args". |
chipx86 | |
No blank line here. |
chipx86 | |
This should take **kwargs. |
chipx86 | |
No trailing blank line. |
chipx86 |
- Commit:
-
657c8766854b8976df6bfdd2d754fda761aaff178e68c0f72028a7a01516d94966a9a28938b58835
Checks run (1 failed, 1 succeeded)
flake8
- Commit:
-
8e68c0f72028a7a01516d94966a9a28938b58835280412ec2d73e3368b12ebd4da40c21da66e5f1c
Checks run (2 succeeded)
- Change Summary:
-
Check for correct setting, cleanup.
- Commit:
-
280412ec2d73e3368b12ebd4da40c21da66e5f1ccc82924d8eea9d84628ff1ccf0e2cdf02baa6fab
Checks run (2 succeeded)
- Change Summary:
-
Addressed David's feedback.
- Commit:
-
cc82924d8eea9d84628ff1ccf0e2cdf02baa6fabb8eeb8086a7ea2aca7c7d02c78b9a4ee09b25eaa
Checks run (2 succeeded)
-
-
-
-
-
-
-
This should be one line.
Why are we even taking
request
? Seems unnecessary. The decorator will still get it. -
This should just use
record_consent_data_list()
, and then there's no need to pullrequest.user
out intouser
(we'll only access it once).We can also get rid of the
tracker = get_consent_tracker()
, just doingget_consent_tracker().record_consent_data_list(...)
.Same comments apply to other tests.
-
-
-
-
Feels like this is too complex an example. It looks like a form is required here. Let's keep it as simple as the plain view.
-
-
- Change Summary:
-
Addressed feedback.
- Commit:
-
b8eeb8086a7ea2aca7c7d02c78b9a4ee09b25eaa4e6b0c0c84b98a5f5e9153968575ed95854ec3a5
- Change Summary:
-
Flake8 fixups
- Commit:
-
4e6b0c0c84b98a5f5e9153968575ed95854ec3a571edf3db91cf4da078ce8bfd7d9f9ef7c07a6622
Checks run (2 succeeded)
- Change Summary:
-
Addressed feedback.
- Commit:
-
71edf3db91cf4da078ce8bfd7d9f9ef7c07a6622a59e02b199f601e1e738214fb4cfc309d0d74528