Commit 5da71ca3 authored by Sharad Heft's avatar Sharad Heft

Store the auth ID always, regardless of settings.

parent 563ae3fd
...@@ -38,6 +38,7 @@ class TESTOAuth2Backend(ModelBackend): ...@@ -38,6 +38,7 @@ class TESTOAuth2Backend(ModelBackend):
defaults={ defaults={
'access_token': token['access_token'], 'access_token': token['access_token'],
'refresh_token': token['refresh_token'], 'refresh_token': token['refresh_token'],
'auth_id': profile['id']
} }
) )
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('test_oauth', '0002_django20'),
]
operations = [
migrations.AddField(
model_name='testoauth2data',
name='auth_id',
field=models.BigIntegerField(default=0, db_index=True),
preserve_default=False,
),
]
...@@ -31,13 +31,15 @@ class TESTOAuth2Data(models.Model): ...@@ -31,13 +31,15 @@ class TESTOAuth2Data(models.Model):
related_name='auth' related_name='auth'
) )
auth_id = models.BigIntegerField(db_index=True)
access_token = models.CharField(max_length=128) access_token = models.CharField(max_length=128)
refresh_token = models.CharField(max_length=128) refresh_token = models.CharField(max_length=128)
primary_character = models.ForeignKey( primary_character = models.ForeignKey(
Character, Character,
on_delete=models.SET_NULL, on_delete=models.SET_NULL,
null=True, null=True,
default=None default=None
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment