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,
classifiers=(
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Framework :: Django",
"Intended Audience :: Developers",
"Natural Language :: English",

View file

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

View file

@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-17 03:34
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import timezone_field.fields

View file

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

View file

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

View file

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

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.apps import AppConfig
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.db.models import Q
from django.utils.translation import ugettext_lazy as _

View file

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

View file

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

View file

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

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.apps import AppConfig
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.utils.translation import ugettext_lazy as _

View file

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

View file

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

View file

@ -1,6 +1,3 @@
from __future__ import unicode_literals
def has_permission(user, proposal, speaker=False, reviewer=False):
"""
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 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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,11 +1,8 @@
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from symposion.markdown_parser import parse
@ -14,7 +11,6 @@ from symposion.conference.models import Section
from symposion.speakers.models import Speaker
@python_2_unicode_compatible
class Schedule(models.Model):
section = models.OneToOneField(Section, verbose_name=_("Section"))
@ -30,7 +26,6 @@ class Schedule(models.Model):
verbose_name_plural = _('Schedules')
@python_2_unicode_compatible
class Day(models.Model):
schedule = models.ForeignKey(Schedule, verbose_name=_("Schedule"))
@ -46,7 +41,6 @@ class Day(models.Model):
verbose_name_plural = _("dates")
@python_2_unicode_compatible
class Room(models.Model):
schedule = models.ForeignKey(Schedule, verbose_name=_("Schedule"))
@ -61,7 +55,6 @@ class Room(models.Model):
verbose_name_plural = _("Rooms")
@python_2_unicode_compatible
class Track(models.Model):
name = models.CharField(max_length=80, verbose_name=_("Track"))
room = models.ForeignKey(Room)
@ -76,7 +69,6 @@ class Track(models.Model):
verbose_name_plural = _("Tracks")
@python_2_unicode_compatible
class SlotKind(models.Model):
"""
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")
@python_2_unicode_compatible
class Slot(models.Model):
name = models.CharField(max_length=512, editable=False)
@ -181,7 +172,6 @@ class Slot(models.Model):
verbose_name_plural = _("slots")
@python_2_unicode_compatible
class SlotRoom(models.Model):
"""
Links a slot with a room.
@ -200,7 +190,6 @@ class SlotRoom(models.Model):
verbose_name_plural = _("Slot rooms")
@python_2_unicode_compatible
class Presentation(models.Model):
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")
@python_2_unicode_compatible
class Session(models.Model):
day = models.ForeignKey(Day, related_name="sessions", verbose_name=_("Day"))
@ -292,7 +280,6 @@ class Session(models.Model):
verbose_name_plural = _("Sessions")
@python_2_unicode_compatible
class SessionRole(models.Model):
SESSION_ROLE_CHAIR = 1

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
import itertools
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 .views import (

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,3 @@
from __future__ import unicode_literals
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
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.safestring import mark_safe
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.utils.translation import ugettext_lazy as _

View file

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

View file

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

View file

@ -1,5 +1,3 @@
from __future__ import unicode_literals
import datetime
from django.conf import settings
@ -7,7 +5,6 @@ from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
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.contrib.auth.models import User
@ -45,7 +42,6 @@ BENEFITS = [
]
@python_2_unicode_compatible
class SponsorLevel(models.Model):
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")
@python_2_unicode_compatible
class Sponsor(models.Model):
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):
name = models.CharField(_("Name"), max_length=100)
@ -246,7 +240,6 @@ class Benefit(models.Model):
return self.name
@python_2_unicode_compatible
class BenefitLevel(models.Model):
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)
@python_2_unicode_compatible
class SponsorBenefit(models.Model):
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
except:
# Python 2
from cStringIO import StringIO
from io import StringIO
import itertools
import logging
import os

View file

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

View file

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

View file

@ -1,9 +1,6 @@
from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import Permission, User
@ -18,7 +15,6 @@ TEAM_ACCESS_CHOICES = [
]
@python_2_unicode_compatible
class Team(models.Model):
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.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.shortcuts import render, redirect