make Admin UI more consistent, better show when provider has no application assigned

This commit is contained in:
Jens Langhammer
2019-02-27 14:47:11 +01:00
parent 95de6a14fd
commit 2db1738e4a
8 changed files with 30 additions and 10 deletions

View File

@ -161,6 +161,10 @@ class Application(PolicyModel):
from passbook.core.policies import PolicyEngine
return PolicyEngine(self.policies.all()).for_user(user).result
def get_provider(self):
"""Get casted provider instance"""
return Provider.objects.get_subclass(pk=self.provider.pk)
def __str__(self):
return self.name