Skip to content

Commit 324cd9c

Browse files
committed
Merge pull request #119 from variable/related_name_fix
more flexible for related name of user field in AbstractApplication model
2 parents 0c53660 + fc7b99a commit 324cd9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oauth2_provider/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class AbstractApplication(models.Model):
6060

6161
client_id = models.CharField(max_length=100, unique=True,
6262
default=generate_client_id, db_index=True)
63-
user = models.ForeignKey(AUTH_USER_MODEL)
63+
user = models.ForeignKey(AUTH_USER_MODEL, related_name="%(app_label)s_%(class)s")
6464
help_text = _("Allowed URIs list, space separated")
6565
redirect_uris = models.TextField(help_text=help_text,
6666
validators=[validate_uris], blank=True)

0 commit comments

Comments
 (0)