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

Issue 1295. Added revert action for migration #1296

Merged
merged 3 commits into from
Sep 15, 2023
Merged

Issue 1295. Added revert action for migration #1296

merged 3 commits into from
Sep 15, 2023

Conversation

yurasavin
Copy link
Contributor

@yurasavin yurasavin commented Jun 30, 2023

Fixes #
Added reverse action for migration 0006

Description of the Change

Without reverse action it's impossible to revert applied migration

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Merging #1296 (be8e7cc) into master (e4b06eb) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1296   +/-   ##
=======================================
  Coverage   97.34%   97.34%           
=======================================
  Files          32       32           
  Lines        2073     2073           
=======================================
  Hits         2018     2018           
  Misses         55       55           

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

Copy link
Member

@n2ygk n2ygk left a comment

Choose a reason for hiding this comment

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

Thanks for this. See the request to add a reverse_func, documentation, etc. per https://django-oauth-toolkit.readthedocs.io/en/latest/contributing.html#pull-requests

@@ -26,5 +26,5 @@ class Migration(migrations.Migration):
name='client_secret',
field=oauth2_provider.models.ClientSecretField(blank=True, db_index=True, default=oauth2_provider.generators.generate_client_secret, help_text='Hashed on Save. Copy it now if this is a new secret.', max_length=255),
),
migrations.RunPython(forwards_func),
migrations.RunPython(forwards_func, migrations.RunPython.noop),
Copy link
Member

Choose a reason for hiding this comment

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

Please add a reverse_func that logs a warning that previously-hashed secrets will fail to revert.

Also please fill out the checklist items (add name to Authors, etc.), update the CHANGELOG, perhaps add a warning about reverse migration of hash secrets, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@n2ygk Sorry for the so long delay in response from me. I've added warning log and updated changelog files. Could you check it please?

@n2ygk n2ygk merged commit 85bd366 into jazzband:master Sep 15, 2023
26 checks passed
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.

2 participants