Skip to content

Change token field type from CharField to TextField in AbstractRefres… #1558

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions oauth2_provider/migrations/0013_change_token_to_textfield.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django A.B.C on YYYY-MM-DD HH:MM
from django.db import migrations, models
from oauth2_provider.settings import oauth2_settings


class Migration(migrations.Migration):

dependencies = [
('oauth2_provider', '0012_add_token_checksum'),
migrations.swappable_dependency(oauth2_settings.REFRESH_TOKEN_MODEL)
]

operations = [
migrations.AlterField(
model_name='refreshtoken',
name='token',
field=models.TextField(),
),
]
2 changes: 1 addition & 1 deletion oauth2_provider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ class AbstractRefreshToken(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="%(app_label)s_%(class)s"
)
token = models.CharField(max_length=255)
token = models.TextField()
application = models.ForeignKey(oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE)
access_token = models.OneToOneField(
oauth2_settings.ACCESS_TOKEN_MODEL,
Expand Down