Make (user, client) unique on UserConsent
We assume this combination is unique with our get and get_or_create calls.
This commit is contained in:
parent
12e2dddb2a
commit
2fc4c138b3
2 changed files with 20 additions and 2 deletions
18
oidc_provider/migrations/0006_unique_user_client.py
Normal file
18
oidc_provider/migrations/0006_unique_user_client.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('oidc_provider', '0005_token_refresh_token'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterUniqueTogether(
|
||||
name='userconsent',
|
||||
unique_together=set([('user', 'client')]),
|
||||
),
|
||||
]
|
|
@ -89,5 +89,5 @@ class Token(BaseCodeTokenModel):
|
|||
|
||||
|
||||
class UserConsent(BaseCodeTokenModel):
|
||||
|
||||
pass
|
||||
class Meta:
|
||||
unique_together = ('user', 'client')
|
||||
|
|
Loading…
Reference in a new issue