Browse Source

fix: SSO 限制用户删除

pull/7447/head
xinwen 3 years ago committed by 老广
parent
commit
89cad224c5
  1. 21
      apps/authentication/migrations/0006_auto_20211227_1059.py
  2. 2
      apps/authentication/models.py

21
apps/authentication/migrations/0006_auto_20211227_1059.py

@ -0,0 +1,21 @@
# Generated by Django 3.1.13 on 2021-12-27 02:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('authentication', '0005_delete_loginconfirmsetting'),
]
operations = [
migrations.AlterField(
model_name='ssotoken',
name='user',
field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User'),
),
]

2
apps/authentication/models.py

@ -44,4 +44,4 @@ class SSOToken(models.JMSBaseModel):
"""
authkey = models.UUIDField(primary_key=True, default=uuid.uuid4, verbose_name=_('Token'))
expired = models.BooleanField(default=False, verbose_name=_('Expired'))
user = models.ForeignKey('users.User', on_delete=models.PROTECT, verbose_name=_('User'), db_constraint=False)
user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name=_('User'), db_constraint=False)

Loading…
Cancel
Save