16 lines
504 B
Python
16 lines
504 B
Python
try:
|
|
from django.contrib.contenttypes.fields import GenericRelation
|
|
django_17 = True
|
|
except ImportError:
|
|
django_17 = False
|
|
from django.contrib.contenttypes.generic import GenericRelation
|
|
|
|
from provider.oauth2.models import Client
|
|
from authentic2.models import LogoutUrl
|
|
|
|
if django_17:
|
|
GenericRelation(LogoutUrl, related_query_name='oauth2_clients')\
|
|
.contribute_to_class(Client, 'logout_url')
|
|
else:
|
|
GenericRelation(LogoutUrl).contribute_to_class(Client, 'logout_url')
|