Skip to content

Commit

Permalink
Merge 8c63288 into ef7909b
Browse files Browse the repository at this point in the history
  • Loading branch information
jdp committed Oct 3, 2017
2 parents ef7909b + 8c63288 commit e8909db
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions oauth2_provider/models.py
Expand Up @@ -151,10 +151,20 @@ def is_usable(self, request):
return True


class ApplicationManager(models.Manager):
def get_by_natural_key(self, client_id):
return self.get(client_id=client_id)


class Application(AbstractApplication):
objects = ApplicationManager()

class Meta(AbstractApplication.Meta):
swappable = "OAUTH2_PROVIDER_APPLICATION_MODEL"

def natural_key(self):
return (self.client_id,)


@python_2_unicode_compatible
class AbstractGrant(models.Model):
Expand Down

0 comments on commit e8909db

Please sign in to comment.