~roadmr/canonical-identity-provider/update-raven

« back to all changes in this revision

Viewing changes to src/ubuntu_sso_saml/views.py

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Daniel Manrique
  • Date: 2018-05-30 20:44:05 UTC
  • mfrom: (1633.1.26 fix-deprecation-warnings-3)
  • Revision ID: otto-copilot@canonical.com-20180530204405-dnj6rlkmn8feffjq
Fix most remaining Django and Python deprecation warnings in the sso codebase itself.

Some of the remaining ones probably need fixing in dependencies:
- django-statsd
- django-openid-auth
- django-piston
- django-honeypot
- raven
- preflight
- oauthlib

Other than the ones from dependencies, the remaining deprecation warnings are:

- most of the middlewares. RemovedInDjango20Warning: Old-style middleware using settings.MIDDLEWARE_CLASSES is deprecated. Update your middleware and use settings.MIDDLEWARE instead.
- identityprovider/models/twofactor.py:103: RemovedInDjango20Warning: Using user.is_authenticated() and user.is_anonymous() as a method is deprecated. Remove the parentheses to use it as an attribute. This needs updating django-openid-auth to make its is_authenticated method an attribute, to avoid ugly "is it callable?" logic in SSO itself.

Merged from https://code.launchpad.net/~roadmr/canonical-identity-provider/fix-deprecation-warnings-3/+merge/347154

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import logging
4
4
from urlparse import urlparse, urlunparse
5
5
 
6
 
from django.core.urlresolvers import reverse
7
6
from django.shortcuts import get_object_or_404, redirect, render
 
7
from django.urls import reverse
8
8
from django.utils.datastructures import MultiValueDictKeyError
9
9
from django.views.decorators.csrf import csrf_exempt
10
10
from saml2idp import registry, saml2idp_metadata, xml_signing