Py2 compatible

This commit is contained in:
Aurélien Delobelle 2016-09-01 00:45:44 +02:00
parent e927ad5801
commit ba0a5d0d27
13 changed files with 80 additions and 1 deletions

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.shortcuts import render
from django.http import Http404
from django.db.models import Q

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import hashlib
from django.contrib.auth.models import User, Permission

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from channels import Group
from channels.generic.websockets import JsonWebsocketConsumer

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.contrib.auth.context_processors import PermWrapper
def auth(request):

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django_cas_ng.decorators import user_passes_test
def kfet_is_team(user):

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from decimal import Decimal
from django import forms
from django.core.exceptions import ValidationError

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from kfet.backends import KFetBackend
class KFetAuthenticationMiddleware(object):

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.db import models
from django.core.urlresolvers import reverse
from django.core.exceptions import PermissionDenied, ValidationError

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from channels.routing import route, route_class
from kfet import consumers

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
@ -31,4 +37,5 @@ def highlight_clipper(clipper, q):
@register.filter()
def ukf(balance, is_cof):
grant = is_cof and (1 + Settings.SUBVENTION_COF() / 100) or 1
return round(balance * 10 * grant)
# float nécessaire car sinon problème avec le round de future.builtins
return round(float(balance * 10 * grant))

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.test import TestCase
# Create your tests here.

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.conf.urls import url
from django.contrib.auth.decorators import permission_required
from kfet import views

View file

@ -1,3 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.shortcuts import render, get_object_or_404, redirect
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.cache import cache