Merge pull request #58 from Sjord/userconsent-unique-client-user
Make (user, client) unique on UserConsent
This commit is contained in:
commit
2d1e246b2c
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):
|
class UserConsent(BaseCodeTokenModel):
|
||||||
|
class Meta:
|
||||||
pass
|
unique_together = ('user', 'client')
|
||||||
|
|
Loading…
Reference in a new issue