File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
rest_framework_social_oauth2/management/commands Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
1
from django .contrib .auth .models import User
2
2
from django .core .management .base import BaseCommand , CommandError
3
+ from django .contrib .auth import get_user_model
3
4
from oauth2_provider .models import Application
4
5
from oauth2_provider .generators import generate_client_id , generate_client_secret
5
6
6
7
8
+ User = get_user_model ()
9
+
10
+
7
11
class Command (BaseCommand ):
8
12
help = "Create a Django OAuth Toolkit application (an existing admin is required)"
9
13
@@ -23,7 +27,7 @@ def add_arguments(self, parser):
23
27
24
28
def handle (self , * args , ** options ):
25
29
new_application = Application (
26
- user = User .objects .filter (is_superuser = True )[0 ],
30
+ user = User .objects .filter (is_superuser = True )[0 ],
27
31
client_type = "confidential" ,
28
32
authorization_grant_type = "password" ,
29
33
name = options ["name" ] or "socialauth_application" ,
You can’t perform that action at this time.
0 commit comments