Py2 compatability has been broke elsewhere drop it

This is all noop in Py3, and Py2 is broke now in various places.
Dropping Py2 code as it will not be a thing going forward.

Django 2 is the next release, Py2 support will be dropped, as such,
dropping this is forward looking.
This commit is contained in:
Sachi King 2017-04-22 10:06:04 +10:00
parent 0652471164
commit 21b2a01a84
51 changed files with 2 additions and 109 deletions

View file

@ -26,7 +26,7 @@ setup(
include_package_data=True, include_package_data=True,
classifiers=( classifiers=(
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
"Programming Language :: Python", "Programming Language :: Python :: 3 :: Only",
"Framework :: Django", "Framework :: Django",
"Intended Audience :: Developers", "Intended Audience :: Developers",
"Natural Language :: English", "Natural Language :: English",

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-17 03:34 # Generated by Django 1.9.7 on 2016-09-17 03:34
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
import timezone_field.fields import timezone_field.fields

View file

@ -1,7 +1,5 @@
from __future__ import unicode_literals
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from timezone_field import TimeZoneField from timezone_field import TimeZoneField
@ -9,7 +7,6 @@ from timezone_field import TimeZoneField
CONFERENCE_CACHE = {} CONFERENCE_CACHE = {}
@python_2_unicode_compatible
class Conference(models.Model): class Conference(models.Model):
""" """
the full conference for a specific year, e.g. US PyCon 2012. the full conference for a specific year, e.g. US PyCon 2012.
@ -45,7 +42,6 @@ class Conference(models.Model):
verbose_name_plural = _("conferences") verbose_name_plural = _("conferences")
@python_2_unicode_compatible
class Section(models.Model): class Section(models.Model):
""" """
a section of the conference such as "Tutorials", "Workshops", a section of the conference such as "Tutorials", "Workshops",

View file

@ -1,5 +1,3 @@
from __future__ import unicode_literals
import bleach import bleach
import markdown import markdown

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
import csv import csv
from django.http import HttpResponse from django.http import HttpResponse

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django import forms from django import forms
from django.db.models import Q from django.db.models import Q
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-17 03:35 # Generated by Django 1.9.7 on 2016-09-17 03:35
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
import django.db.models.deletion import django.db.models.deletion

View file

@ -1,11 +1,9 @@
from __future__ import unicode_literals
import os import os
import uuid import uuid
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db import models from django.db import models
from django.db.models import Q from django.db.models import Q
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now from django.utils.timezone import now
@ -21,7 +19,6 @@ from symposion.conference.models import Section
from symposion.speakers.models import Speaker from symposion.speakers.models import Speaker
@python_2_unicode_compatible
class ProposalSection(models.Model): class ProposalSection(models.Model):
""" """
configuration of proposal submissions for a specific Section. configuration of proposal submissions for a specific Section.
@ -60,7 +57,6 @@ class ProposalSection(models.Model):
return self.section.name return self.section.name
@python_2_unicode_compatible
class ProposalKind(models.Model): class ProposalKind(models.Model):
""" """
e.g. talk vs panel vs tutorial vs poster e.g. talk vs panel vs tutorial vs poster
@ -78,7 +74,6 @@ class ProposalKind(models.Model):
return self.name return self.name
@python_2_unicode_compatible
class ProposalBase(models.Model): class ProposalBase(models.Model):
objects = InheritanceManager() objects = InheritanceManager()
@ -209,7 +204,6 @@ class ProposalBase(models.Model):
reversion.register(ProposalBase) reversion.register(ProposalBase)
@python_2_unicode_compatible
class AdditionalSpeaker(models.Model): class AdditionalSpeaker(models.Model):
SPEAKING_STATUS_PENDING = 1 SPEAKING_STATUS_PENDING = 1

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
import hashlib import hashlib
import random import random
import sys import sys

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-17 03:35 # Generated by Django 1.9.7 on 2016-09-17 03:35
from __future__ import unicode_literals
import datetime import datetime
from decimal import Decimal from decimal import Decimal
from django.conf import settings from django.conf import settings

View file

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime from datetime import datetime
from decimal import Decimal from decimal import Decimal

View file

@ -1,6 +1,3 @@
from __future__ import unicode_literals
def has_permission(user, proposal, speaker=False, reviewer=False): def has_permission(user, proposal, speaker=False, reviewer=False):
""" """
Returns whether or not ther user has permission to review this proposal, Returns whether or not ther user has permission to review this proposal,

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.contrib import admin from django.contrib import admin
from symposion.schedule.models import Schedule, Day, Room, SlotKind, Slot, SlotRoom, Presentation, Session, SessionRole, Track from symposion.schedule.models import Schedule, Day, Room, SlotKind, Slot, SlotRoom, Presentation, Session, SessionRole, Track

View file

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

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
import csv import csv
import time import time

View file

@ -2,7 +2,6 @@
This file contains functions that are useful to humans at the shell for This file contains functions that are useful to humans at the shell for
manipulating the database in more natural ways. manipulating the database in more natural ways.
""" """
from __future__ import unicode_literals
from django.db import transaction from django.db import transaction
from .models import Schedule, Day, Room, Slot, SlotKind, SlotRoom from .models import Schedule, Day, Room, Slot, SlotKind, SlotRoom

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-17 03:35 # Generated by Django 1.9.7 on 2016-09-17 03:35
from __future__ import unicode_literals
import datetime import datetime
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,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-18 00:43 # Generated by Django 1.9.7 on 2016-09-18 00:43
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-13 04:30 # Generated by Django 1.9.7 on 2016-11-13 04:30
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-09 20:53 # Generated by Django 1.9.7 on 2016-12-09 20:53
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-10 06:05 # Generated by Django 1.9.7 on 2016-12-10 06:05
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-10 06:36 # Generated by Django 1.9.7 on 2016-12-10 06:36
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-24 00:10 # Generated by Django 1.9.7 on 2016-12-24 00:10
from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-24 06:09 # Generated by Django 1.9.7 on 2016-12-24 06: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,11 +1,8 @@
from __future__ import unicode_literals
import datetime import datetime
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from symposion.markdown_parser import parse from symposion.markdown_parser import parse
@ -14,7 +11,6 @@ from symposion.conference.models import Section
from symposion.speakers.models import Speaker from symposion.speakers.models import Speaker
@python_2_unicode_compatible
class Schedule(models.Model): class Schedule(models.Model):
section = models.OneToOneField(Section, verbose_name=_("Section")) section = models.OneToOneField(Section, verbose_name=_("Section"))
@ -30,7 +26,6 @@ class Schedule(models.Model):
verbose_name_plural = _('Schedules') verbose_name_plural = _('Schedules')
@python_2_unicode_compatible
class Day(models.Model): class Day(models.Model):
schedule = models.ForeignKey(Schedule, verbose_name=_("Schedule")) schedule = models.ForeignKey(Schedule, verbose_name=_("Schedule"))
@ -46,7 +41,6 @@ class Day(models.Model):
verbose_name_plural = _("dates") verbose_name_plural = _("dates")
@python_2_unicode_compatible
class Room(models.Model): class Room(models.Model):
schedule = models.ForeignKey(Schedule, verbose_name=_("Schedule")) schedule = models.ForeignKey(Schedule, verbose_name=_("Schedule"))
@ -61,7 +55,6 @@ class Room(models.Model):
verbose_name_plural = _("Rooms") verbose_name_plural = _("Rooms")
@python_2_unicode_compatible
class Track(models.Model): class Track(models.Model):
name = models.CharField(max_length=80, verbose_name=_("Track")) name = models.CharField(max_length=80, verbose_name=_("Track"))
room = models.ForeignKey(Room) room = models.ForeignKey(Room)
@ -76,7 +69,6 @@ class Track(models.Model):
verbose_name_plural = _("Tracks") verbose_name_plural = _("Tracks")
@python_2_unicode_compatible
class SlotKind(models.Model): class SlotKind(models.Model):
""" """
A slot kind represents what kind a slot is. For example, a slot can be a A slot kind represents what kind a slot is. For example, a slot can be a
@ -94,7 +86,6 @@ class SlotKind(models.Model):
verbose_name_plural = _("Slot kinds") verbose_name_plural = _("Slot kinds")
@python_2_unicode_compatible
class Slot(models.Model): class Slot(models.Model):
name = models.CharField(max_length=512, editable=False) name = models.CharField(max_length=512, editable=False)
@ -181,7 +172,6 @@ class Slot(models.Model):
verbose_name_plural = _("slots") verbose_name_plural = _("slots")
@python_2_unicode_compatible
class SlotRoom(models.Model): class SlotRoom(models.Model):
""" """
Links a slot with a room. Links a slot with a room.
@ -200,7 +190,6 @@ class SlotRoom(models.Model):
verbose_name_plural = _("Slot rooms") verbose_name_plural = _("Slot rooms")
@python_2_unicode_compatible
class Presentation(models.Model): class Presentation(models.Model):
slot = models.OneToOneField(Slot, null=True, blank=True, related_name="content_ptr", verbose_name=_("Slot")) slot = models.OneToOneField(Slot, null=True, blank=True, related_name="content_ptr", verbose_name=_("Slot"))
@ -247,7 +236,6 @@ class Presentation(models.Model):
verbose_name_plural = _("presentations") verbose_name_plural = _("presentations")
@python_2_unicode_compatible
class Session(models.Model): class Session(models.Model):
day = models.ForeignKey(Day, related_name="sessions", verbose_name=_("Day")) day = models.ForeignKey(Day, related_name="sessions", verbose_name=_("Day"))
@ -292,7 +280,6 @@ class Session(models.Model):
verbose_name_plural = _("Sessions") verbose_name_plural = _("Sessions")
@python_2_unicode_compatible
class SessionRole(models.Model): class SessionRole(models.Model):
SESSION_ROLE_CHAIR = 1 SESSION_ROLE_CHAIR = 1

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
import itertools import itertools
from django.db.models import Count, Min from django.db.models import Count, Min

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.conf.urls import url from django.conf.urls import url
from .views import ( from .views import (

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
import json import json
import pytz import pytz

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.contrib import admin from django.contrib import admin
from symposion.speakers.models import Speaker from symposion.speakers.models import Speaker

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django import forms from django import forms
from symposion.speakers.models import Speaker from symposion.speakers.models import Speaker

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-17 03:35 # Generated by Django 1.9.7 on 2016-09-17 03:35
from __future__ import unicode_literals
import datetime import datetime
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,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-30 08:09 # Generated by Django 1.9.7 on 2016-12-30 08:09
from __future__ import unicode_literals
from django.db import migrations from django.db import migrations

View file

@ -1,10 +1,7 @@
from __future__ import unicode_literals
import datetime import datetime
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User from django.contrib.auth.models import User
@ -12,7 +9,6 @@ from django.contrib.auth.models import User
from symposion.markdown_parser import parse from symposion.markdown_parser import parse
@python_2_unicode_compatible
class Speaker(models.Model): class Speaker(models.Model):
SESSION_COUNT_CHOICES = [ SESSION_COUNT_CHOICES = [

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.conf.urls import url from django.conf.urls import url
from .views import ( from .views import (

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404 from django.http import Http404
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404

View file

@ -1,5 +1,3 @@
from __future__ import unicode_literals
from django.utils.html import escape from django.utils.html import escape
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django import forms from django import forms
from django.forms.models import inlineformset_factory, BaseInlineFormSet from django.forms.models import inlineformset_factory, BaseInlineFormSet

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-17 03:35 # Generated by Django 1.9.7 on 2016-09-17 03:35
from __future__ import unicode_literals
import datetime import datetime
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,5 +1,3 @@
from __future__ import unicode_literals
import datetime import datetime
from django.conf import settings from django.conf import settings
@ -7,7 +5,6 @@ from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db import models from django.db import models
from django.db.models.signals import post_init, post_save from django.db.models.signals import post_init, post_save
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User from django.contrib.auth.models import User
@ -45,7 +42,6 @@ BENEFITS = [
] ]
@python_2_unicode_compatible
class SponsorLevel(models.Model): class SponsorLevel(models.Model):
conference = models.ForeignKey(Conference, verbose_name=_("Conference")) conference = models.ForeignKey(Conference, verbose_name=_("Conference"))
@ -66,7 +62,6 @@ class SponsorLevel(models.Model):
return self.sponsor_set.filter(active=True).order_by("added") return self.sponsor_set.filter(active=True).order_by("added")
@python_2_unicode_compatible
class Sponsor(models.Model): class Sponsor(models.Model):
applicant = models.ForeignKey(User, related_name="sponsorships", verbose_name=_("Applicant"), applicant = models.ForeignKey(User, related_name="sponsorships", verbose_name=_("Applicant"),
@ -232,7 +227,6 @@ CONTENT_TYPE_CHOICES = [
] ]
@python_2_unicode_compatible
class Benefit(models.Model): class Benefit(models.Model):
name = models.CharField(_("Name"), max_length=100) name = models.CharField(_("Name"), max_length=100)
@ -246,7 +240,6 @@ class Benefit(models.Model):
return self.name return self.name
@python_2_unicode_compatible
class BenefitLevel(models.Model): class BenefitLevel(models.Model):
benefit = models.ForeignKey(Benefit, related_name="benefit_levels", verbose_name=_("Benefit")) benefit = models.ForeignKey(Benefit, related_name="benefit_levels", verbose_name=_("Benefit"))
@ -265,7 +258,6 @@ class BenefitLevel(models.Model):
return "%s - %s" % (self.level, self.benefit) return "%s - %s" % (self.level, self.benefit)
@python_2_unicode_compatible
class SponsorBenefit(models.Model): class SponsorBenefit(models.Model):
sponsor = models.ForeignKey(Sponsor, related_name="sponsor_benefits", verbose_name=_("Sponsor")) sponsor = models.ForeignKey(Sponsor, related_name="sponsor_benefits", verbose_name=_("Sponsor"))

View file

@ -1,9 +1,4 @@
from __future__ import unicode_literals
try:
from io import StringIO from io import StringIO
except:
# Python 2
from cStringIO import StringIO
import itertools import itertools
import logging import logging
import os import os

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django import forms from django import forms
from django.utils.html import escape from django.utils.html import escape

View file

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

View file

@ -1,9 +1,6 @@
from __future__ import unicode_literals
import datetime import datetime
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import Permission, User from django.contrib.auth.models import Permission, User
@ -18,7 +15,6 @@ TEAM_ACCESS_CHOICES = [
] ]
@python_2_unicode_compatible
class Team(models.Model): class Team(models.Model):
slug = models.SlugField(unique=True, verbose_name=_("Slug")) slug = models.SlugField(unique=True, verbose_name=_("Slug"))

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.http import Http404, HttpResponseNotAllowed from django.http import Http404, HttpResponseNotAllowed
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404

View file

@ -1,5 +1,3 @@
from __future__ import unicode_literals
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect from django.shortcuts import render, redirect