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

« back to all changes in this revision

Viewing changes to src/identityprovider/utils.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:
15
15
from django.conf import settings
16
16
from django.contrib.sessions.models import Session
17
17
from django.core.exceptions import ObjectDoesNotExist
18
 
from django.core.urlresolvers import reverse
19
18
from django.db import connection, transaction
20
19
from django.db.utils import ProgrammingError
 
20
from django.urls import reverse
21
21
from django.utils.translation import ugettext_lazy as _
22
22
 
23
23
SALT_LENGTH = 20