X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/blobdiff_plain/08d3502c8f9a169713122c681d86eb16d9f8c1e6..c4e712fdcc2a728dee5515070b15555648c074a6:/cas_provider/views.py diff --git a/cas_provider/views.py b/cas_provider/views.py index 7204ae2..ff7dcd7 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -14,9 +14,7 @@ from models import ServiceTicket from utils import create_service_ticket from exceptions import SameEmailMismatchedPasswords -#FIXME: Remove this dependency -from accounts.models import IdentifierHistory -from django.contrib.auth.models import User +from . import signals __all__ = ['login', 'validate', 'logout'] @@ -139,9 +137,8 @@ def validate(request): username = ticket.user.username ticket.delete() - histories = IdentifierHistory.objects.filter(user__email__iexact=ticket.user.email) - histories = '\n'.join(histories.values_list('identifier', flat=True)) - histories = '%s\n' % histories if histories else '' + results = signals.on_cas_collect_histories.send(sender=validate, for_email=ticket.user.email) + histories = '\n'.join('\n'.join(rs) for rc, rs in results) return HttpResponse("yes\n%s\n%s" % (username, histories))