first pass with 2to3

This commit is contained in:
Thomas Steen Rasmussen 2017-01-30 12:16:07 +01:00
parent 0ff37bbca5
commit 3a7b952090
107 changed files with 184 additions and 184 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
import uuid import uuid

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-17 17:18 # Generated by Django 1.9.1 on 2016-01-17 17:18
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-22 20:19 # Generated by Django 1.9.2 on 2016-04-22 20:19
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-06 20:16 # Generated by Django 1.9.5 on 2016-05-06 20:16
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-10 20:11 # Generated by Django 1.9.6 on 2016-05-10 20:11
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-04 17:05 # Generated by Django 1.9.6 on 2016-08-04 17:05
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-12 18:03 # Generated by Django 1.10.4 on 2016-12-12 18:03
from __future__ import unicode_literals
import datetime import datetime
from django.conf import settings from django.conf import settings

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-12 18:09 # Generated by Django 1.10.4 on 2016-12-12 18:09
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-20 16:45 # Generated by Django 1.10.4 on 2016-12-20 16:45
from __future__ import unicode_literals
import datetime import datetime
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-20 17:14 # Generated by Django 1.10.4 on 2016-12-20 17:14
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-28 17:50 # Generated by Django 1.10.4 on 2016-12-28 17:50
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-28 23:12 # Generated by Django 1.10.4 on 2016-12-28 23:12
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 22:01 # Generated by Django 1.10.4 on 2016-12-29 22:01
from __future__ import unicode_literals
import django.contrib.postgres.fields.ranges import django.contrib.postgres.fields.ranges
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 22:02 # Generated by Django 1.10.4 on 2016-12-29 22:02
from __future__ import unicode_literals
import django.contrib.postgres.fields.ranges import django.contrib.postgres.fields.ranges
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-16 16:34 # Generated by Django 1.10.4 on 2017-01-16 16:34
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-16 16:37 # Generated by Django 1.10.4 on 2017-01-16 16:37
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-16 21:59 # Generated by Django 1.10.4 on 2017-01-16 21:59
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-28 17:41 # Generated by Django 1.10.5 on 2017-01-28 17:41
from __future__ import unicode_literals
import django.contrib.postgres.fields.ranges import django.contrib.postgres.fields.ranges
from django.db import migrations from django.db import migrations

View file

@ -91,7 +91,7 @@ class Camp(CreatedUpdatedModel, UUIDModel):
field = getattr(self, camppart) field = getattr(self, camppart)
if not hasattr(field, '__class__') or not hasattr(field.__class__, '__name__') or not field.__class__.__name__ == 'DateTimeTZRange': if not hasattr(field, '__class__') or not hasattr(field.__class__, '__name__') or not field.__class__.__name__ == 'DateTimeTZRange':
print("this attribute is not a datetimetzrange field: %s" % field) print(("this attribute is not a datetimetzrange field: %s" % field))
return False return False
daycount = (field.upper - field.lower).days daycount = (field.upper - field.lower).days

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-24 22:11 # Generated by Django 1.10.4 on 2016-12-24 22:11
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-28 23:12 # Generated by Django 1.10.4 on 2016-12-28 23:12
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.contrib import messages from django.contrib import messages
from django.db import models from django.db import models
from utils.models import CreatedUpdatedModel from utils.models import CreatedUpdatedModel

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig

View file

@ -24,19 +24,19 @@ class Plugin(object):
def server_ready(self, **kwargs): def server_ready(self, **kwargs):
"""triggered after the server sent the MOTD (require core plugin)""" """triggered after the server sent the MOTD (require core plugin)"""
if settings.DEBUG: if settings.DEBUG:
print("inside server_ready(), kwargs: %s" % kwargs) print(("inside server_ready(), kwargs: %s" % kwargs))
def connection_lost(self, **kwargs): def connection_lost(self, **kwargs):
"""triggered when connection is lost""" """triggered when connection is lost"""
if settings.DEBUG: if settings.DEBUG:
print("inside connection_lost(), kwargs: %s" % kwargs) print(("inside connection_lost(), kwargs: %s" % kwargs))
def connection_made(self, **kwargs): def connection_made(self, **kwargs):
"""triggered when connection is up""" """triggered when connection is up"""
if settings.DEBUG: if settings.DEBUG:
print("inside connection_made(), kwargs: %s" % kwargs) print(("inside connection_made(), kwargs: %s" % kwargs))
############################################################################################### ###############################################################################################
@ -46,7 +46,7 @@ class Plugin(object):
def on_join_part_quit(self, **kwargs): def on_join_part_quit(self, **kwargs):
"""triggered when there is a join part or quit on a channel the bot is in""" """triggered when there is a join part or quit on a channel the bot is in"""
if settings.DEBUG: if settings.DEBUG:
print("inside on_join_part_quit(), kwargs: %s" % kwargs) print(("inside on_join_part_quit(), kwargs: %s" % kwargs))
if self.bot.nick == kwargs['mask'].split("!")[0] and kwargs['channel'] == "#tirsdagsfilm": if self.bot.nick == kwargs['mask'].split("!")[0] and kwargs['channel'] == "#tirsdagsfilm":
self.bot.loop.call_later(1, self.bot.get_outgoing_messages) self.bot.loop.call_later(1, self.bot.get_outgoing_messages)
@ -55,13 +55,13 @@ class Plugin(object):
def on_privmsg(self, **kwargs): def on_privmsg(self, **kwargs):
"""triggered when a privmsg is sent to the bot or to a channel the bot is in""" """triggered when a privmsg is sent to the bot or to a channel the bot is in"""
if settings.DEBUG: if settings.DEBUG:
print("inside on_privmsg(), kwargs: %s" % kwargs) print(("inside on_privmsg(), kwargs: %s" % kwargs))
@irc3.event(irc3.rfc.KICK) @irc3.event(irc3.rfc.KICK)
def on_kick(self, **kwargs): def on_kick(self, **kwargs):
if settings.DEBUG: if settings.DEBUG:
print("inside on_kick(), kwargs: %s" % kwargs) print(("inside on_kick(), kwargs: %s" % kwargs))
############################################################################################### ###############################################################################################
@ -78,12 +78,12 @@ class Plugin(object):
print("inside get_outgoing_messages()") print("inside get_outgoing_messages()")
for msg in OutgoingIrcMessage.objects.filter(processed=False).order_by('created_date'): for msg in OutgoingIrcMessage.objects.filter(processed=False).order_by('created_date'):
if msg.target[0] == "#" and msg.target in self.bot.channels: if msg.target[0] == "#" and msg.target in self.bot.channels:
print("sending privmsg to %s: %s" % (msg.target, msg.message)) print(("sending privmsg to %s: %s" % (msg.target, msg.message)))
self.bot.privmsg(msg.target, msg.message) self.bot.privmsg(msg.target, msg.message)
msg.processed=True msg.processed=True
msg.save() msg.save()
else: else:
print("skipping message to channel %s because the bot is not in the channel" % msg.target) print(("skipping message to channel %s because the bot is not in the channel" % msg.target))
# call this function again in 60 seconds # call this function again in 60 seconds
self.bot.loop.call_later(60, self.bot.get_outgoing_messages) self.bot.loop.call_later(60, self.bot.get_outgoing_messages)

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-29 20:29 # Generated by Django 1.10.5 on 2017-01-29 20:29
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from utils.models import UUIDModel, CreatedUpdatedModel from utils.models import UUIDModel, CreatedUpdatedModel
from django.db import models from django.db import models

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-30 19:12 # Generated by Django 1.9.6 on 2016-05-30 19:12
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-30 22:23 # Generated by Django 1.9.6 on 2016-05-30 22:23
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-05 21:26 # Generated by Django 1.9.2 on 2016-06-05 21:26
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-10 17:43 # Generated by Django 1.9.6 on 2016-06-10 17:43
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-18 19:02 # Generated by Django 1.9.2 on 2016-06-18 19:02
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-20 11:27 # Generated by Django 1.10.4 on 2016-12-20 11:27
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-20 11:36 # Generated by Django 1.10.4 on 2016-12-20 11:36
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-20 13:03 # Generated by Django 1.10.4 on 2016-12-20 13:03
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.db import models from django.db import models
from django.utils import encoding from django.utils import encoding

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations from django.db import models, migrations
from django.conf import settings from django.conf import settings

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-13 19:38 # Generated by Django 1.9.6 on 2016-07-13 19:38
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-04 17:05 # Generated by Django 1.9.6 on 2016-08-04 17:05
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-04 17:11 # Generated by Django 1.9.6 on 2016-08-04 17:11
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-04 17:12 # Generated by Django 1.9.6 on 2016-08-04 17:12
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-07 13:12 # Generated by Django 1.9.6 on 2016-08-07 13:12
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-07 13:20 # Generated by Django 1.9.6 on 2016-08-07 13:20
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-07 13:33 # Generated by Django 1.9.6 on 2016-08-07 13:33
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-08-08 17:47 # Generated by Django 1.9.2 on 2016-08-08 17:47
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-27 07:52 # Generated by Django 1.9.6 on 2016-08-27 07:52
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-12 18:09 # Generated by Django 1.10.4 on 2016-12-12 18:09
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 21:49 # Generated by Django 1.10.4 on 2016-12-29 21:49
from __future__ import unicode_literals
import django.contrib.postgres.fields.ranges import django.contrib.postgres.fields.ranges
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-29 21:50 # Generated by Django 1.10.4 on 2016-12-29 21:50
from __future__ import unicode_literals
import django.contrib.postgres.fields.ranges import django.contrib.postgres.fields.ranges
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-21 12:12 # Generated by Django 1.10.5 on 2017-01-21 12:12
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-22 13:39 # Generated by Django 1.10.5 on 2017-01-22 13:39
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-28 17:41 # Generated by Django 1.10.5 on 2017-01-28 17:41
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.contrib.postgres.fields import DateTimeRangeField from django.contrib.postgres.fields import DateTimeRangeField
from django.db import models from django.db import models
from django.utils.text import slugify from django.utils.text import slugify

View file

@ -18,7 +18,7 @@ def send_email(emailtype, recipient, formatdict, subject, sender='BornHack <info
elif emailtype == 'testmail': elif emailtype == 'testmail':
text_template = 'emails/testmail.txt' text_template = 'emails/testmail.txt'
else: else:
print 'Unknown email type: %s' % emailtype print('Unknown email type: %s' % emailtype)
return False return False
try: try:
@ -34,7 +34,7 @@ def send_email(emailtype, recipient, formatdict, subject, sender='BornHack <info
msg.attach(attachment_filename, attachment, 'application/pdf') msg.attach(attachment_filename, attachment, 'application/pdf')
except Exception as E: except Exception as E:
print 'exception while rendering email: %s' % E print('exception while rendering email: %s' % E)
return False return False
### send the email ### send the email

View file

@ -21,7 +21,7 @@ def calculate_epay_hash(order, request):
def validate_epay_callback(query): def validate_epay_callback(query):
hashstring = '' hashstring = ''
for key, value in query.iteritems(): for key, value in query.items():
if key != 'hash': if key != 'hash':
hashstring += value hashstring += value
hash = hashlib.md5(hashstring + settings.EPAY_MD5_SECRET).hexdigest() hash = hashlib.md5(hashstring + settings.EPAY_MD5_SECRET).hexdigest()

View file

@ -15,27 +15,27 @@ def api_epay_callback(request):
try: try:
order = EpayOrder.objects.get(id=request.GET['orderid'][1:]) order = EpayOrder.objects.get(id=request.GET['orderid'][1:])
except EpayOrder.DoesNotExist: except EpayOrder.DoesNotExist:
print "epay callback - epayorder %s not found" % request.GET['orderid'] print("epay callback - epayorder %s not found" % request.GET['orderid'])
return HttpResponse("Not OK") return HttpResponse("Not OK")
### check hash here ### check hash here
if 'hash' not in request.GET: if 'hash' not in request.GET:
print "epay callback - missing epay hash" print("epay callback - missing epay hash")
return HttpResponse("Not OK") return HttpResponse("Not OK")
### this does not work sometimes, ordering is off maybe? ### this does not work sometimes, ordering is off maybe?
hashstring = '' hashstring = ''
qs = request.META['QUERY_STRING'] qs = request.META['QUERY_STRING']
print "querystring is %s" % qs print("querystring is %s" % qs)
for kv in qs.split("&"): for kv in qs.split("&"):
print "hashstring is now %s" % hashstring print("hashstring is now %s" % hashstring)
if kv.split("=")[0] != "hash": if kv.split("=")[0] != "hash":
hashstring += kv.split("=")[1] hashstring += kv.split("=")[1]
print "hashstring is now %s" % hashstring print("hashstring is now %s" % hashstring)
hashstring += settings.EPAY_MD5_SECRET hashstring += settings.EPAY_MD5_SECRET
epayhash = hashlib.md5(hashstring).hexdigest() epayhash = hashlib.md5(hashstring).hexdigest()
if epayhash != request.GET['hash']: if epayhash != request.GET['hash']:
print "epay callback - wrong epay hash" print("epay callback - wrong epay hash")
return HttpResponse("Not OK") return HttpResponse("Not OK")
### save callback in epayorder ### save callback in epayorder
@ -61,7 +61,7 @@ def api_epay_callback(request):
### save ### save
order.save() order.save()
else: else:
print "epay callback - order %s not recognized" % request.GET['orderid'] print("epay callback - order %s not recognized" % request.GET['orderid'])
return HttpResponse("Not OK") return HttpResponse("Not OK")
return HttpResponse("OK") return HttpResponse("OK")
@ -103,7 +103,7 @@ def epay_order(request):
### save epay order with commit=False ### save epay order with commit=False
epayorder = form.save(commit=False) epayorder = form.save(commit=False)
except Exception as E: except Exception as E:
print "unable to save epay order with commit=false" print("unable to save epay order with commit=false")
return render(request, 'epay_order_fail.html', { return render(request, 'epay_order_fail.html', {
'message': _('Unable to save epay order. Please try again, and please contact us if the problem persists.') 'message': _('Unable to save epay order. Please try again, and please contact us if the problem persists.')
}) })

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-10 20:00 # Generated by Django 1.9.6 on 2016-05-10 20:00
from __future__ import unicode_literals
from django.conf import settings from django.conf import settings
import django.contrib.postgres.fields.jsonb import django.contrib.postgres.fields.jsonb

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-10 20:02 # Generated by Django 1.9.6 on 2016-05-10 20:02
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-13 06:46 # Generated by Django 1.9.2 on 2016-05-13 06:46
from __future__ import unicode_literals
import django.contrib.postgres.fields.ranges import django.contrib.postgres.fields.ranges
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-15 16:04 # Generated by Django 1.9.6 on 2016-05-15 16:04
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-15 16:14 # Generated by Django 1.9.6 on 2016-05-15 16:14
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-15 16:15 # Generated by Django 1.9.6 on 2016-05-15 16:15
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-15 21:57 # Generated by Django 1.9.6 on 2016-05-15 21:57
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-16 09:54 # Generated by Django 1.9.6 on 2016-05-16 09:54
from __future__ import unicode_literals
import datetime import datetime
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-17 06:00 # Generated by Django 1.9.2 on 2016-05-17 06:00
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-17 13:13 # Generated by Django 1.9.2 on 2016-05-17 13:13
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-17 19:02 # Generated by Django 1.9.2 on 2016-05-17 19:02
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-23 15:08 # Generated by Django 1.9.6 on 2016-05-23 15:08
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-25 16:58 # Generated by Django 1.9.6 on 2016-05-25 16:58
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-25 17:02 # Generated by Django 1.9.6 on 2016-05-25 17:02
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-29 10:47 # Generated by Django 1.9.2 on 2016-05-29 10:47
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb import django.contrib.postgres.fields.jsonb
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-29 11:22 # Generated by Django 1.9.2 on 2016-05-29 11:22
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb import django.contrib.postgres.fields.jsonb
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-29 16:26 # Generated by Django 1.9.2 on 2016-05-29 16:26
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-29 17:36 # Generated by Django 1.9.2 on 2016-05-29 17:36
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-30 15:29 # Generated by Django 1.9.2 on 2016-05-30 15:29
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-30 18:24 # Generated by Django 1.9.2 on 2016-05-30 18:24
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-30 22:23 # Generated by Django 1.9.6 on 2016-05-30 22:23
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-30 23:01 # Generated by Django 1.9.6 on 2016-05-30 23:01
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-01 08:53 # Generated by Django 1.9.6 on 2016-06-01 08:53
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-05 21:26 # Generated by Django 1.9.2 on 2016-06-05 21:26
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-18 19:02 # Generated by Django 1.9.2 on 2016-06-18 19:02
from __future__ import unicode_literals
from django.conf import settings from django.conf import settings
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-06-18 22:15 # Generated by Django 1.9.2 on 2016-06-18 22:15
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-07-12 20:36 # Generated by Django 1.9.2 on 2016-07-12 20:36
from __future__ import unicode_literals
from django.conf import settings from django.conf import settings
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-07-12 21:19 # Generated by Django 1.9.2 on 2016-07-12 21:19
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-07-12 21:33 # Generated by Django 1.9.2 on 2016-07-12 21:33
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-08-27 07:52 # Generated by Django 1.9.6 on 2016-08-27 07:52
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-09 10:00 # Generated by Django 1.10.3 on 2016-11-09 10:00
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-09 11:46 # Generated by Django 1.10.3 on 2016-11-09 11:46
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-12 17:56 # Generated by Django 1.10.4 on 2016-12-12 17:56
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -2,7 +2,7 @@ from wkhtmltopdf.views import PDFTemplateResponse
from PyPDF2 import PdfFileWriter, PdfFileReader from PyPDF2 import PdfFileWriter, PdfFileReader
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.conf import settings from django.conf import settings
import StringIO import io
def generate_pdf_letter(filename, template, formatdict): def generate_pdf_letter(filename, template, formatdict):
### produce text-only PDF from template ### produce text-only PDF from template
@ -15,7 +15,7 @@ def generate_pdf_letter(filename, template, formatdict):
'margin-bottom': 50, 'margin-bottom': 50,
}, },
) )
textonlypdf = StringIO.StringIO() textonlypdf = io.StringIO()
textonlypdf.write(pdfgenerator.rendered_content) textonlypdf.write(pdfgenerator.rendered_content)
### create a blank pdf to work with ### create a blank pdf to work with
@ -28,7 +28,7 @@ def generate_pdf_letter(filename, template, formatdict):
watermark = PdfFileReader(open(settings.LETTERHEAD_PDF_PATH, 'rb')) watermark = PdfFileReader(open(settings.LETTERHEAD_PDF_PATH, 'rb'))
### add the watermark to all pages ### add the watermark to all pages
for pagenum in xrange(pdfreader.getNumPages()): for pagenum in range(pdfreader.getNumPages()):
page = watermark.getPage(0) page = watermark.getPage(0)
try: try:
page.mergePage(pdfreader.getPage(pagenum)) page.mergePage(pdfreader.getPage(pagenum))
@ -41,10 +41,10 @@ def generate_pdf_letter(filename, template, formatdict):
### save the generated pdf to the archive ### save the generated pdf to the archive
with open(settings.PDF_ARCHIVE_PATH+filename, 'wb') as fh: with open(settings.PDF_ARCHIVE_PATH+filename, 'wb') as fh:
finalpdf.write(fh) finalpdf.write(fh)
print('Saved pdf to archive: %s' % settings.PDF_ARCHIVE_PATH+filename) print(('Saved pdf to archive: %s' % settings.PDF_ARCHIVE_PATH+filename))
### return a file object with the data ### return a file object with the data
returnfile = StringIO.StringIO() returnfile = io.StringIO()
finalpdf.write(returnfile) finalpdf.write(returnfile)
return returnfile return returnfile

View file

@ -538,7 +538,7 @@ class CoinifyRedirectView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsureUn
# check if it expired # check if it expired
if parse_datetime(order.coinifyapiinvoice.invoicejson['expire_time']) < timezone.now(): if parse_datetime(order.coinifyapiinvoice.invoicejson['expire_time']) < timezone.now():
# this coinifyinvoice expired, delete it # this coinifyinvoice expired, delete it
print("deleting expired coinifyinvoice id %s" % order.coinifyapiinvoice.invoicejson['id']) print(("deleting expired coinifyinvoice id %s" % order.coinifyapiinvoice.invoicejson['id']))
order.coinifyapiinvoice.delete() order.coinifyapiinvoice.delete()
order = self.get_object() order = self.get_object()
@ -565,10 +565,10 @@ class CoinifyRedirectView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsureUn
# Parse response # Parse response
if not response['success']: if not response['success']:
api_error = response['error'] api_error = response['error']
print("API error: %s (%s)" % ( print(("API error: %s (%s)" % (
api_error['message'], api_error['message'],
api_error['code'] api_error['code']
)) )))
messages.error(request, "There was a problem with the payment provider. Please try again later") messages.error(request, "There was a problem with the payment provider. Please try again later")
return HttpResponseRedirect(reverse_lazy('shop:order_detail', kwargs={'pk': self.get_object().pk})) return HttpResponseRedirect(reverse_lazy('shop:order_detail', kwargs={'pk': self.get_object().pk}))
else: else:
@ -577,7 +577,7 @@ class CoinifyRedirectView(LoginRequiredMixin, EnsureUserOwnsOrderMixin, EnsureUn
invoicejson = response['data'], invoicejson = response['data'],
order = order, order = order,
) )
print("created new coinifyinvoice id %s" % coinifyinvoice.invoicejson['id']) print(("created new coinifyinvoice id %s" % coinifyinvoice.invoicejson['id']))
return super(CoinifyRedirectView, self).dispatch( return super(CoinifyRedirectView, self).dispatch(
request, *args, **kwargs request, *args, **kwargs
) )
@ -600,7 +600,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
# make a dict with all HTTP_ headers # make a dict with all HTTP_ headers
headerdict = {} headerdict = {}
for key, value in request.META.items(): for key, value in list(request.META.items()):
if key[:5] == 'HTTP_': if key[:5] == 'HTTP_':
headerdict[key[5:]] = value headerdict[key[5:]] = value
@ -622,7 +622,7 @@ class CoinifyCallbackView(SingleObjectMixin, View):
try: try:
coinifyinvoice = CoinifyAPIInvoice.objects.get(invoicejson__id=callbackjson['data']['id']) coinifyinvoice = CoinifyAPIInvoice.objects.get(invoicejson__id=callbackjson['data']['id'])
except CoinifyAPIInvoice.DoesNotExist: except CoinifyAPIInvoice.DoesNotExist:
print("unable to find CoinifyAPIInvoice with id %s" % callbackjson['data']['id']) print(("unable to find CoinifyAPIInvoice with id %s" % callbackjson['data']['id']))
return HttpResponseBadRequest('bad coinifyinvoice id') return HttpResponseBadRequest('bad coinifyinvoice id')
# save new coinifyinvoice payload # save new coinifyinvoice payload

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig

View file

@ -29,11 +29,11 @@ class Command(BaseCommand):
), ),
camp=( camp=(
timezone.datetime(2016, 8, 27, 12, 0, tzinfo=timezone.utc), timezone.datetime(2016, 8, 27, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2016, 9, 04, 11, 59, tzinfo=timezone.utc), timezone.datetime(2016, 9, 0o4, 11, 59, tzinfo=timezone.utc),
), ),
teardown=( teardown=(
timezone.datetime(2016, 9, 04, 12, 0, tzinfo=timezone.utc), timezone.datetime(2016, 9, 0o4, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2016, 9, 06, 12, 0, tzinfo=timezone.utc), timezone.datetime(2016, 9, 0o6, 12, 0, tzinfo=timezone.utc),
), ),
) )
@ -47,11 +47,11 @@ class Command(BaseCommand):
), ),
camp=( camp=(
timezone.datetime(2017, 8, 27, 12, 0, tzinfo=timezone.utc), timezone.datetime(2017, 8, 27, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2017, 9, 04, 11, 59, tzinfo=timezone.utc), timezone.datetime(2017, 9, 0o4, 11, 59, tzinfo=timezone.utc),
), ),
teardown=( teardown=(
timezone.datetime(2017, 9, 04, 12, 0, tzinfo=timezone.utc), timezone.datetime(2017, 9, 0o4, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2017, 9, 06, 12, 0, tzinfo=timezone.utc), timezone.datetime(2017, 9, 0o6, 12, 0, tzinfo=timezone.utc),
), ),
) )
@ -65,11 +65,11 @@ class Command(BaseCommand):
), ),
camp=( camp=(
timezone.datetime(2018, 8, 27, 12, 0, tzinfo=timezone.utc), timezone.datetime(2018, 8, 27, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2018, 9, 04, 11, 59, tzinfo=timezone.utc), timezone.datetime(2018, 9, 0o4, 11, 59, tzinfo=timezone.utc),
), ),
teardown=( teardown=(
timezone.datetime(2018, 9, 04, 12, 0, tzinfo=timezone.utc), timezone.datetime(2018, 9, 0o4, 12, 0, tzinfo=timezone.utc),
timezone.datetime(2018, 9, 06, 12, 0, tzinfo=timezone.utc), timezone.datetime(2018, 9, 0o6, 12, 0, tzinfo=timezone.utc),
), ),
) )

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-05 21:38 # Generated by Django 1.9.6 on 2016-07-05 21:38
from __future__ import unicode_literals
from django.conf import settings from django.conf import settings
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-05 21:54 # Generated by Django 1.9.6 on 2016-07-05 21:54
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-05 21:59 # Generated by Django 1.9.6 on 2016-07-05 21:59
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-10 16:58 # Generated by Django 1.9.6 on 2016-07-10 16:58
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

Some files were not shown because too many files have changed in this diff Show more