Skip to content

Commit

Permalink
Merge pull request #360 from jazzband/giovanni/fix-settings-dict
Browse files Browse the repository at this point in the history
fix: Fix migration when not overriding `AuthToken` model
  • Loading branch information
giovannicimolin authored Jul 19, 2024
2 parents cbecef3 + 4f4cde2 commit 48dd83f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 5.0.1
- Fix migration: retrieve `TOKEN_MODEL` from `knox_settings` instead of Django settings.

## 5.0.0
- Tokens created prior to this release will no longer work
- Fix migration reverse flow, enable migrate 0
Expand Down
4 changes: 3 additions & 1 deletion knox/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
from django.conf import settings
from django.db import migrations, models

from knox.settings import knox_settings


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
migrations.swappable_dependency(settings.KNOX_TOKEN_MODEL),
migrations.swappable_dependency(knox_settings.TOKEN_MODEL),
]

operations = [
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='5.0.0',
version='5.0.1',
description='Authentication for django rest framework',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 48dd83f

Please sign in to comment.