Skip to content

Commit d78c40d

Browse files
authored
Merge pull request #236 from bmpenuelas/master
Reference the User model with get_user_model()
2 parents 00f2803 + 77a95b8 commit d78c40d

File tree

1 file changed

+5
-1
lines changed
  • rest_framework_social_oauth2/management/commands

1 file changed

+5
-1
lines changed

rest_framework_social_oauth2/management/commands/createapp.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
from django.contrib.auth.models import User
22
from django.core.management.base import BaseCommand, CommandError
3+
from django.contrib.auth import get_user_model
34
from oauth2_provider.models import Application
45
from oauth2_provider.generators import generate_client_id, generate_client_secret
56

67

8+
User = get_user_model()
9+
10+
711
class Command(BaseCommand):
812
help = "Create a Django OAuth Toolkit application (an existing admin is required)"
913

@@ -23,7 +27,7 @@ def add_arguments(self, parser):
2327

2428
def handle(self, *args, **options):
2529
new_application = Application(
26-
user= User.objects.filter(is_superuser=True)[0],
30+
user=User.objects.filter(is_superuser=True)[0],
2731
client_type="confidential",
2832
authorization_grant_type="password",
2933
name=options["name"] or "socialauth_application",

0 commit comments

Comments
 (0)