Commit 371525e8 authored by Sharad Heft's avatar Sharad Heft

Update the reusable app for Django 2.0.

parent 815ee0e3
......@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='test_oauth2_django',
version='0.1',
version='0.2',
description='A basic library for Django apps to use TEST Alliance OAuth2.',
url='https://git.pleaseignore.com/sharad/test_oauth2_django',
author='Sharad Heft',
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('test_oauth', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='testoauth2data',
name='primary_character',
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, default=None, to='test_oauth.Character', null=True),
preserve_default=True,
),
]
......@@ -26,6 +26,7 @@ class Character(models.Model):
class TESTOAuth2Data(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
primary_key=True,
related_name='auth'
)
......@@ -33,7 +34,12 @@ class TESTOAuth2Data(models.Model):
access_token = models.CharField(max_length=128)
refresh_token = models.CharField(max_length=128)
primary_character = models.ForeignKey(Character, null=True, default=None)
primary_character = models.ForeignKey(
Character,
on_delete=models.SET_NULL,
null=True,
default=None
)
class Meta:
verbose_name = 'OAuth2 Token'
......
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