Skip to content
Snippets Groups Projects
Unverified Commit f33aa837 authored by Marco Ciotola's avatar Marco Ciotola
Browse files

[DJ1.9] Fix some imports for django 1.9

parent 6b71ca96
No related branches found
No related tags found
No related merge requests found
...@@ -6,28 +6,26 @@ Ben Adida ...@@ -6,28 +6,26 @@ Ben Adida
(ben@adida.net) (ben@adida.net)
""" """
from django.db import models, transaction import datetime
import json import io
from django.conf import settings import random
from django.core.mail import send_mail import uuid
import datetime, logging, uuid, random, io
import bleach import bleach
import copy
import csv
import unicodecsv
from django.conf import settings
from django.db import models, transaction
from crypto import electionalgs, algs, utils from crypto import algs, utils
from helios import utils as heliosutils
import helios.views
from helios import datatypes from helios import datatypes
from helios import utils as heliosutils
from helios.datatypes.djangofield import LDObjectField
from helios_auth.jsonfield import JSONField
# useful stuff in helios_auth # useful stuff in helios_auth
from helios_auth.models import User, AUTH_SYSTEMS from helios_auth.models import User, AUTH_SYSTEMS
from helios_auth.jsonfield import JSONField
from helios.datatypes.djangofield import LDObjectField
import csv, copy
import unicodecsv
class HeliosModel(models.Model, datatypes.LDObjectContainer): class HeliosModel(models.Model, datatypes.LDObjectContainer):
class Meta: class Meta:
...@@ -578,6 +576,7 @@ class Election(HeliosModel): ...@@ -578,6 +576,7 @@ class Election(HeliosModel):
@property @property
def url(self): def url(self):
import helios.views
return helios.views.get_election_url(self) return helios.views.get_election_url(self)
def init_tally(self): def init_tally(self):
......
...@@ -6,11 +6,7 @@ Ben Adida ...@@ -6,11 +6,7 @@ Ben Adida
reworked 2011-01-09 reworked 2011-01-09
""" """
from helios.crypto import algs, utils from helios.crypto import algs
import logging
import uuid
import datetime
from helios import models
from . import WorkflowObject from . import WorkflowObject
class EncryptedAnswer(WorkflowObject): class EncryptedAnswer(WorkflowObject):
......
...@@ -6,13 +6,11 @@ GAE ...@@ -6,13 +6,11 @@ GAE
Ben Adida Ben Adida
(ben@adida.net) (ben@adida.net)
""" """
from django.db import models from django.db import models
from jsonfield import JSONField from jsonfield import JSONField
import datetime, logging from auth_systems import AUTH_SYSTEMS
from auth_systems import AUTH_SYSTEMS, can_check_constraint, can_list_categories
# an exception to catch when a user is no longer authenticated # an exception to catch when a user is no longer authenticated
class AuthenticationExpired(Exception): class AuthenticationExpired(Exception):
......
...@@ -4,19 +4,16 @@ Generic Security -- for the auth system ...@@ -4,19 +4,16 @@ Generic Security -- for the auth system
Ben Adida (ben@adida.net) Ben Adida (ben@adida.net)
""" """
# nicely update the wrapper function import uuid
from functools import update_wrapper
from django.http import HttpResponse, Http404, HttpResponseRedirect
from django.core.exceptions import *
from django.conf import settings from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.http import HttpResponseNotAllowed from django.http import HttpResponseNotAllowed
from django.http import HttpResponseRedirect
# nicely update the wrapper function
from functools import update_wrapper
import oauth import oauth
from helios_auth.models import User
import uuid
from helios_auth.models import *
FIELDS_TO_SAVE = 'FIELDS_TO_SAVE' FIELDS_TO_SAVE = 'FIELDS_TO_SAVE'
......
...@@ -2,13 +2,10 @@ ...@@ -2,13 +2,10 @@
Glue some events together Glue some events together
""" """
from django.conf import settings import helios.signals
from django.core.urlresolvers import reverse import helios.views
from django.conf import settings
from helios.view_utils import render_template_raw from helios.view_utils import render_template_raw
import helios.views, helios.signals
import views
def vote_cast_send_message(user, voter, election, cast_vote, **kwargs): def vote_cast_send_message(user, voter, election, cast_vote, **kwargs):
## FIXME: this doesn't work for voters that are not also users ## FIXME: this doesn't work for voters that are not also users
......
...@@ -2,23 +2,15 @@ ...@@ -2,23 +2,15 @@
server_ui specific views server_ui specific views
""" """
from helios.models import * import copy
from helios_auth.security import *
from view_utils import *
import helios.views
import helios
from helios.crypto import utils as cryptoutils
from helios_auth.security import *
from helios.security import can_create_election
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseNotAllowed
from django.conf import settings from django.conf import settings
import copy
import helios_auth.views as auth_views import helios_auth.views as auth_views
from helios.models import Election
from helios.security import can_create_election
from helios_auth.security import get_user
from view_utils import render_template
def get_election(): def get_election():
return None return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment