This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
authentic2-idp-oauth2/authentic2_idp_oauth2/models.py

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')