-
Notifications
You must be signed in to change notification settings - Fork 54
Feat: add Terms of Use accept view and middleware #1217
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
Conversation
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
bcbd456 to
e25b960
Compare
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
e25b960 to
3c2a3bc
Compare
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
|
can be reviewed when tests pass |
jochenklar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I think I will need test it some more with ORCID etc. when we have a release candidate, but I think this approach will work for all.
I think what is still missing is the integration with the social signup form, like the account sign up already has. |
…d add checks Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
…ial tests Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
jochenklar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done!
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
jochenklar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚂 Awesome, merge! (after tests)
Description
Related issue: #141, #161
It adds a migration for the
ConsentFieldValuemodel:accounts.0022_add_created_updated_to_consentSo it requires a
python manage.py migrate.I have added some methods that handle the consent and session to the model class.
In the settings from
core/settings.py, theTermsAndConditionsRedirectMiddlewarewas added as default to theMIDDLEWARE. It will only have an effect when theACCOUNT_TERMS_OF_USEis set toTrue.❗ Breaking Changes
rdmo/accounts/adapter.pyis renamed toaccount.pyrdmo/accounts/adapter.py→rdmo/accounts/account.pyConfiguration in the rdmo-app
When
ACCOUNT_TERMS_OF_USEis enabled, some settings need to be configured in the rdmo-app as well.An optional feature is added that sets the date on which the ToU text is valid, so that it can be easily updated when the text might change. The optional setting is
TERMS_VERSION_DATEand needs to be a valid date string that is compatible with formats from djangoget_format('DATE_INPUT_FORMATS'). The date of this setting checks if the user has updated their consent on or after that date, otherwise the consent is invalid and asked to accept again.Optionally, in the
urls.py:Motivation and Context
How has this been tested?
Screenshots (if appropriate)