@@ -96,9 +96,9 @@ def clean(self):
9696 from django .core .exceptions import ValidationError
9797 if not self .redirect_uris \
9898 and self .authorization_grant_type \
99- in (Application .GRANT_ALLINONE ,
100- Application .GRANT_AUTHORIZATION_CODE ,
101- Application .GRANT_IMPLICIT ):
99+ in (AbstractApplication .GRANT_ALLINONE ,
100+ AbstractApplication .GRANT_AUTHORIZATION_CODE ,
101+ AbstractApplication .GRANT_IMPLICIT ):
102102 error = _ ('Redirect_uris could not be empty with {} grant_type' )
103103 raise ValidationError (error .format (self .authorization_grant_type ))
104104
@@ -131,7 +131,7 @@ class Grant(models.Model):
131131 """
132132 user = models .ForeignKey (User )
133133 code = models .CharField (max_length = 255 ) # code comes from oauthlib
134- application = models .ForeignKey (Application )
134+ application = models .ForeignKey (oauth2_settings . APPLICATION_MODEL )
135135 expires = models .DateTimeField ()
136136 redirect_uri = models .CharField (max_length = 255 )
137137 scope = models .TextField (blank = True )
@@ -166,7 +166,7 @@ class AccessToken(models.Model):
166166 """
167167 user = models .ForeignKey (User )
168168 token = models .CharField (max_length = 255 )
169- application = models .ForeignKey (Application )
169+ application = models .ForeignKey (oauth2_settings . APPLICATION_MODEL )
170170 expires = models .DateTimeField ()
171171 scope = models .TextField (blank = True )
172172
@@ -218,7 +218,7 @@ class RefreshToken(models.Model):
218218 """
219219 user = models .ForeignKey (User )
220220 token = models .CharField (max_length = 255 )
221- application = models .ForeignKey (Application )
221+ application = models .ForeignKey (oauth2_settings . APPLICATION_MODEL )
222222 access_token = models .OneToOneField (AccessToken ,
223223 related_name = 'refresh_token' )
224224
0 commit comments