This repository was archived by the owner on May 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
rest_framework_jwt/refreshtoken Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+ from __future__ import unicode_literals
3+
4+ from django .db import models , migrations
5+
6+
7+ class Migration (migrations .Migration ):
8+
9+ dependencies = [
10+ ('refreshtoken' , '0001_initial' ),
11+ ]
12+
13+ operations = [
14+ migrations .AlterField (
15+ model_name = 'refreshtoken' ,
16+ name = 'app' ,
17+ field = models .CharField (max_length = 255 ),
18+ ),
19+ migrations .AlterUniqueTogether (
20+ name = 'refreshtoken' ,
21+ unique_together = set ([('user' , 'app' )]),
22+ ),
23+ ]
Original file line number Diff line number Diff line change @@ -25,9 +25,12 @@ class RefreshToken(models.Model):
2525 """
2626 key = models .CharField (max_length = 40 , primary_key = True )
2727 user = models .ForeignKey (AUTH_USER_MODEL , related_name = 'refresh_tokens' )
28- app = models .CharField (max_length = 255 , unique = True )
28+ app = models .CharField (max_length = 255 )
2929 created = models .DateTimeField (auto_now_add = True )
3030
31+ class Meta :
32+ unique_together = ('user' , 'app' )
33+
3134 def save (self , * args , ** kwargs ):
3235 if not self .key :
3336 self .key = self .generate_key ()
You can’t perform that action at this time.
0 commit comments