Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #25 from edx/renzo/support-old-django
Browse files Browse the repository at this point in the history
Finer-grained control of how to import the User model
  • Loading branch information
Renzo Lucioni committed Jul 17, 2015
2 parents 7a2e80a + faa6019 commit 31a2b2c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion oauth2_provider/management/commands/create_oauth2_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json
from optparse import make_option

from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.management.base import BaseCommand, CommandError
from django.core.validators import URLValidator
Expand All @@ -11,6 +10,13 @@
from oauth2_provider.models import TrustedClient


try:
from django.contrib.auth import get_user_model
except ImportError: # Django <1.5
from django.contrib.auth.models import User
else:
User = get_user_model()

ARG_STRING = '<url> <redirect_uri> <client_type: "confidential" | "public">'


Expand Down

0 comments on commit 31a2b2c

Please sign in to comment.