Browse Source

Enforce strict relationship between Player and Token

Fixes #1
master
parent
commit
8679c3a29b
Signed by: Orhideous <[email protected]> GPG Key ID: 62E078AB621B0D15
2 changed files with 21 additions and 1 deletions
  1. +20
    -0
      lavender/migrations/0008_strict_token.py
  2. +1
    -1
      lavender/models.py

+ 20
- 0
lavender/migrations/0008_strict_token.py View File

@@ -0,0 +1,20 @@
# Generated by Django 2.2.1 on 2020-01-07 12:11

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('lavender', '0007_fix_gamelog'),
]

operations = [
migrations.AlterField(
model_name='token',
name='player',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]

+ 1
- 1
lavender/models.py View File

@@ -24,7 +24,7 @@ class LogHistory(models.Model):


class Token(models.Model):
player: Player = models.ForeignKey(Player, on_delete=models.CASCADE)
player: Player = models.OneToOneField(Player, on_delete=models.CASCADE)

access = models.CharField(max_length=32, null=True)
client = models.CharField(max_length=32, null=True)


Loading…
Cancel
Save