few flake8 and python3 problems corrected
This commit is contained in:
@ -16,10 +16,6 @@ import django
|
||||
from django.test import Client
|
||||
from django.template import loader
|
||||
from django.utils import timezone
|
||||
if django.VERSION < (1, 8):
|
||||
from django.template import Context
|
||||
else:
|
||||
Context = lambda x:x
|
||||
|
||||
import cgi
|
||||
import six
|
||||
@ -33,6 +29,13 @@ from cas_server import models
|
||||
from cas_server import utils
|
||||
|
||||
|
||||
if django.VERSION < (1, 8):
|
||||
from django.template import Context
|
||||
else:
|
||||
def Context(arg):
|
||||
return arg
|
||||
|
||||
|
||||
def return_unicode(string, charset):
|
||||
"""make `string` a unicode if `string` is a unicode or bytes encoded with `charset`"""
|
||||
if not isinstance(string, six.text_type):
|
||||
|
Reference in New Issue
Block a user