Mass style-check update
Seems okay.
This commit is contained in:
parent
97748a0f7f
commit
39b556b7ac
14 changed files with 138 additions and 115 deletions
|
@ -1,10 +1,10 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.http import HttpResponseForbidden
|
from django.http import HttpResponseForbidden
|
||||||
from django.shortcuts import redirect
|
|
||||||
from django.template import Context, RequestContext, loader
|
from django.template import Context, RequestContext, loader
|
||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from django.utils.version import get_docs_version
|
from django.utils.version import get_docs_version
|
||||||
|
|
||||||
|
|
||||||
def csrf_failure(request, reason=""):
|
def csrf_failure(request, reason=""):
|
||||||
|
|
||||||
from django.middleware.csrf import REASON_BAD_TOKEN, REASON_NO_REFERER, REASON_NO_CSRF_COOKIE
|
from django.middleware.csrf import REASON_BAD_TOKEN, REASON_NO_REFERER, REASON_NO_CSRF_COOKIE
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from django.utils.cache import add_never_cache_headers
|
from django.utils.cache import add_never_cache_headers
|
||||||
|
|
||||||
|
|
||||||
class DisableClientSideCachingMiddleware(object):
|
class DisableClientSideCachingMiddleware(object):
|
||||||
def process_response(self, request, response):
|
def process_response(self, request, response):
|
||||||
add_never_cache_headers(response)
|
add_never_cache_headers(response)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.mail import EmailMultiAlternatives
|
from django.core.mail import EmailMultiAlternatives # noqa: F401
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ def do_monkey_patch():
|
||||||
|
|
||||||
# Remove this function from existence
|
# Remove this function from existence
|
||||||
global do_monkey_patch
|
global do_monkey_patch
|
||||||
do_monkey_patch = lambda: None
|
do_monkey_patch = lambda: None # noqa: E731
|
||||||
|
|
||||||
|
|
||||||
def patch_speaker_profile_form():
|
def patch_speaker_profile_form():
|
||||||
|
@ -34,7 +34,7 @@ def patch_speaker_profile_form():
|
||||||
fields["accessibility"].widget = widgets.AceMarkdownEditor()
|
fields["accessibility"].widget = widgets.AceMarkdownEditor()
|
||||||
|
|
||||||
|
|
||||||
def patch_mail_to_send_bcc():
|
def patch_mail_to_send_bcc(): # noqa: C901
|
||||||
''' Patches django.core.mail's message classes to send a BCC e-mail to
|
''' Patches django.core.mail's message classes to send a BCC e-mail to
|
||||||
the default BCC e-mail address. '''
|
the default BCC e-mail address. '''
|
||||||
|
|
||||||
|
@ -80,7 +80,6 @@ def patch_mail_to_send_bcc():
|
||||||
|
|
||||||
return tuple(a[:pos] + (bcc,) + a[pos + 1:])
|
return tuple(a[:pos] + (bcc,) + a[pos + 1:])
|
||||||
|
|
||||||
|
|
||||||
def patch_bcc_keyword(f, k):
|
def patch_bcc_keyword(f, k):
|
||||||
''' Adds our BCC list to the BCC list in the keyword arguments, and
|
''' Adds our BCC list to the BCC list in the keyword arguments, and
|
||||||
returns the new version of the keyword arguments.
|
returns the new version of the keyword arguments.
|
||||||
|
@ -139,13 +138,14 @@ def fix_sitetree_check_access_500s():
|
||||||
|
|
||||||
SiteTree.check_access = check_access
|
SiteTree.check_access = check_access
|
||||||
|
|
||||||
|
|
||||||
def never_cache_login_page():
|
def never_cache_login_page():
|
||||||
from django.views.decorators.cache import never_cache
|
from django.views.decorators.cache import never_cache
|
||||||
from account.views import LoginView
|
from account.views import LoginView
|
||||||
LoginView.get = never_cache(LoginView.get)
|
LoginView.get = never_cache(LoginView.get)
|
||||||
|
|
||||||
|
|
||||||
def patch_stripe_payment_form():
|
def patch_stripe_payment_form(): # noqa: C901
|
||||||
|
|
||||||
import inspect # Oh no.
|
import inspect # Oh no.
|
||||||
from django.http.request import HttpRequest
|
from django.http.request import HttpRequest
|
||||||
|
|
|
@ -18,7 +18,6 @@ from symposion.proposals import models as symposion_models
|
||||||
@admin.register(models.KnowledgeProposal)
|
@admin.register(models.KnowledgeProposal)
|
||||||
@admin.register(models.LawProposal)
|
@admin.register(models.LawProposal)
|
||||||
@admin.register(models.OpenHardwareProposal)
|
@admin.register(models.OpenHardwareProposal)
|
||||||
|
|
||||||
class CategoryAdmin(admin.ModelAdmin):
|
class CategoryAdmin(admin.ModelAdmin):
|
||||||
|
|
||||||
class AdditionalSpeakerInline(admin.TabularInline):
|
class AdditionalSpeakerInline(admin.TabularInline):
|
||||||
|
|
|
@ -8,6 +8,7 @@ from .models import KernelProposal, OpenRadioProposal, SecurityProposal
|
||||||
from .models import GamesProposal, TestingProposal, LawProposal, OpenHardwareProposal
|
from .models import GamesProposal, TestingProposal, LawProposal, OpenHardwareProposal
|
||||||
from .models import KnowledgeProposal
|
from .models import KnowledgeProposal
|
||||||
|
|
||||||
|
|
||||||
class ProposalForm(forms.ModelForm):
|
class ProposalForm(forms.ModelForm):
|
||||||
|
|
||||||
def clean_description(self):
|
def clean_description(self):
|
||||||
|
@ -37,9 +38,9 @@ class TalkProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,9 +62,9 @@ class TutorialProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,11 +80,12 @@ class MiniconfProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class SysAdminProposalForm(ProposalForm):
|
class SysAdminProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -102,11 +104,12 @@ class SysAdminProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class WriteTheDocsProposalForm(ProposalForm):
|
class WriteTheDocsProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -125,11 +128,12 @@ class WriteTheDocsProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class RadioProposalForm(ProposalForm):
|
class RadioProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -147,11 +151,12 @@ class RadioProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class KernelProposalForm(ProposalForm):
|
class KernelProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -169,11 +174,12 @@ class KernelProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class WootconfProposalForm(ProposalForm):
|
class WootconfProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -191,11 +197,12 @@ class WootconfProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class SecurityProposalForm(ProposalForm):
|
class SecurityProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -213,11 +220,12 @@ class SecurityProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class GamesProposalForm(ProposalForm):
|
class GamesProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -236,11 +244,12 @@ class GamesProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class TestingProposalForm(ProposalForm):
|
class TestingProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -258,11 +267,12 @@ class TestingProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class KnowledgeProposalForm(ProposalForm):
|
class KnowledgeProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -280,11 +290,12 @@ class KnowledgeProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class LawProposalForm(ProposalForm):
|
class LawProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -302,11 +313,12 @@ class LawProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class OpenHardwareProposalForm(ProposalForm):
|
class OpenHardwareProposalForm(ProposalForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -325,7 +337,7 @@ class OpenHardwareProposalForm(ProposalForm):
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"abstract" : widgets.AceMarkdownEditor(),
|
"abstract": widgets.AceMarkdownEditor(),
|
||||||
"private_abstract" : widgets.AceMarkdownEditor(),
|
"private_abstract": widgets.AceMarkdownEditor(),
|
||||||
"technical_requirements" : widgets.AceMarkdownEditor(),
|
"technical_requirements": widgets.AceMarkdownEditor(),
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,16 +45,19 @@ class TalkProposal(Proposal):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "talk proposal"
|
verbose_name = "talk proposal"
|
||||||
|
|
||||||
|
|
||||||
class TutorialProposal(Proposal):
|
class TutorialProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "tutorial proposal"
|
verbose_name = "tutorial proposal"
|
||||||
|
|
||||||
|
|
||||||
class MiniconfProposal(ProposalBase):
|
class MiniconfProposal(ProposalBase):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "miniconf proposal"
|
verbose_name = "miniconf proposal"
|
||||||
|
|
||||||
|
|
||||||
class SysAdminProposal(Proposal):
|
class SysAdminProposal(Proposal):
|
||||||
|
|
||||||
TYPE_SHORT_PRESENTATION = 1
|
TYPE_SHORT_PRESENTATION = 1
|
||||||
|
@ -65,12 +68,14 @@ class SysAdminProposal(Proposal):
|
||||||
(TYPE_LIGHTNING_TALK, "Lightning Talk (5-10 min)"),
|
(TYPE_LIGHTNING_TALK, "Lightning Talk (5-10 min)"),
|
||||||
]
|
]
|
||||||
|
|
||||||
talk_format = models.IntegerField(choices=TALK_FORMATS,
|
talk_format = models.IntegerField(
|
||||||
|
choices=TALK_FORMATS,
|
||||||
help_text="Please indicate your preferred talk length in the private abstract field below.")
|
help_text="Please indicate your preferred talk length in the private abstract field below.")
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "System Administration Miniconf Proposal"
|
verbose_name = "System Administration Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class WriteTheDocsProposal(Proposal):
|
class WriteTheDocsProposal(Proposal):
|
||||||
|
|
||||||
TYPE_LONG_PRESENTATION = 1
|
TYPE_LONG_PRESENTATION = 1
|
||||||
|
@ -86,26 +91,31 @@ class WriteTheDocsProposal(Proposal):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "WriteThe Docs Miniconf Proposal"
|
verbose_name = "WriteThe Docs Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class OpenRadioProposal(Proposal):
|
class OpenRadioProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "OpenRadio Miniconf Proposal"
|
verbose_name = "OpenRadio Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class WootconfProposal(Proposal):
|
class WootconfProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "WOOTCONF Miniconf Proposal"
|
verbose_name = "WOOTCONF Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class KernelProposal(Proposal):
|
class KernelProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Kernel Miniconf Proposal"
|
verbose_name = "Kernel Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class SecurityProposal(Proposal):
|
class SecurityProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Security/Privacy Miniconf Proposal"
|
verbose_name = "Security/Privacy Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class GamesProposal(Proposal):
|
class GamesProposal(Proposal):
|
||||||
|
|
||||||
TYPE_PRESENTATION = 1
|
TYPE_PRESENTATION = 1
|
||||||
|
@ -123,21 +133,25 @@ class GamesProposal(Proposal):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Games and FOSS Miniconf Proposal"
|
verbose_name = "Games and FOSS Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class TestingProposal(Proposal):
|
class TestingProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Testing/Automation Miniconf Proposal"
|
verbose_name = "Testing/Automation Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class KnowledgeProposal(Proposal):
|
class KnowledgeProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Open Knowledge Australia Miniconf Proposal"
|
verbose_name = "Open Knowledge Australia Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class LawProposal(Proposal):
|
class LawProposal(Proposal):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Open Law and Policy Miniconf Proposal"
|
verbose_name = "Open Law and Policy Miniconf Proposal"
|
||||||
|
|
||||||
|
|
||||||
class OpenHardwareProposal(Proposal):
|
class OpenHardwareProposal(Proposal):
|
||||||
|
|
||||||
TYPE_NORMAL_PRESENTATION = 1
|
TYPE_NORMAL_PRESENTATION = 1
|
||||||
|
|
|
@ -8,7 +8,7 @@ class YesNoField(forms.TypedChoiceField):
|
||||||
def __init__(self, *a, **k):
|
def __init__(self, *a, **k):
|
||||||
super(YesNoField, self).__init__(
|
super(YesNoField, self).__init__(
|
||||||
*a,
|
*a,
|
||||||
coerce=lambda x: x =='True',
|
coerce=lambda x: x == 'True',
|
||||||
choices=((False, 'No'), (True, 'Yes')),
|
choices=((False, 'No'), (True, 'Yes')),
|
||||||
widget=forms.RadioSelect,
|
widget=forms.RadioSelect,
|
||||||
**k
|
**k
|
||||||
|
@ -22,12 +22,11 @@ class ProfileForm(forms.ModelForm):
|
||||||
model = models.AttendeeProfile
|
model = models.AttendeeProfile
|
||||||
exclude = ['attendee']
|
exclude = ['attendee']
|
||||||
field_classes = {
|
field_classes = {
|
||||||
"of_legal_age" : YesNoField,
|
"of_legal_age": YesNoField,
|
||||||
}
|
}
|
||||||
widgets = {
|
widgets = {
|
||||||
"past_lca" : forms.widgets.CheckboxSelectMultiple(),
|
"past_lca": forms.widgets.CheckboxSelectMultiple(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Media:
|
class Media:
|
||||||
js = ("lca2017/js/profile_form.js", )
|
js = ("lca2017/js/profile_form.js", )
|
||||||
|
|
|
@ -4,13 +4,15 @@ from datetime import timedelta
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from django.contrib.auth.models import Group
|
from django.contrib.auth.models import Group
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.core.management.base import BaseCommand, CommandError
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from registrasion.models import inventory as inv
|
from registrasion.models import inventory as inv
|
||||||
from registrasion.models import conditions as cond
|
from registrasion.models import conditions as cond
|
||||||
from symposion import proposals
|
from symposion import proposals
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
|
||||||
help = 'Populates the inventory with the LCA2017 inventory model'
|
help = 'Populates the inventory with the LCA2017 inventory model'
|
||||||
|
|
||||||
def add_arguments(self, parser):
|
def add_arguments(self, parser):
|
||||||
|
@ -55,7 +57,7 @@ class Command(BaseCommand):
|
||||||
description="Each type of ticket has different included products. "
|
description="Each type of ticket has different included products. "
|
||||||
"For details of what products are included, see our "
|
"For details of what products are included, see our "
|
||||||
"[LINK]registration details page.[/LINK]",
|
"[LINK]registration details page.[/LINK]",
|
||||||
required = True,
|
required=True,
|
||||||
render_type=inv.Category.RENDER_TYPE_RADIO,
|
render_type=inv.Category.RENDER_TYPE_RADIO,
|
||||||
limit_per_user=1,
|
limit_per_user=1,
|
||||||
order=1,
|
order=1,
|
||||||
|
@ -68,7 +70,7 @@ class Command(BaseCommand):
|
||||||
"Wednesday 18 January. All attendees may purchase "
|
"Wednesday 18 January. All attendees may purchase "
|
||||||
"seats at the dinner, even if a dinner ticket is not "
|
"seats at the dinner, even if a dinner ticket is not "
|
||||||
"included in your conference ticket price.",
|
"included in your conference ticket price.",
|
||||||
required = False,
|
required=False,
|
||||||
render_type=inv.Category.RENDER_TYPE_QUANTITY,
|
render_type=inv.Category.RENDER_TYPE_QUANTITY,
|
||||||
limit_per_user=10,
|
limit_per_user=10,
|
||||||
order=10,
|
order=10,
|
||||||
|
@ -81,7 +83,7 @@ class Command(BaseCommand):
|
||||||
"evening of Tuesday 17 January. You may purchase up "
|
"evening of Tuesday 17 January. You may purchase up "
|
||||||
"to 5 tickets in total, for significant others, and "
|
"to 5 tickets in total, for significant others, and "
|
||||||
"family members.",
|
"family members.",
|
||||||
required = False,
|
required=False,
|
||||||
render_type=inv.Category.RENDER_TYPE_QUANTITY,
|
render_type=inv.Category.RENDER_TYPE_QUANTITY,
|
||||||
limit_per_user=5,
|
limit_per_user=5,
|
||||||
order=20,
|
order=20,
|
||||||
|
@ -95,7 +97,7 @@ class Command(BaseCommand):
|
||||||
"January, and is restricted to Professional Ticket "
|
"January, and is restricted to Professional Ticket "
|
||||||
"holders, speakers, miniconf organisers, and invited "
|
"holders, speakers, miniconf organisers, and invited "
|
||||||
"guests.",
|
"guests.",
|
||||||
required = False,
|
required=False,
|
||||||
render_type=inv.Category.RENDER_TYPE_RADIO,
|
render_type=inv.Category.RENDER_TYPE_RADIO,
|
||||||
limit_per_user=1,
|
limit_per_user=1,
|
||||||
order=30,
|
order=30,
|
||||||
|
@ -106,7 +108,7 @@ class Command(BaseCommand):
|
||||||
name="T-Shirt",
|
name="T-Shirt",
|
||||||
description="Commemorative conference t-shirts, featuring secret "
|
description="Commemorative conference t-shirts, featuring secret "
|
||||||
"linux.conf.au 2017 artwork.",
|
"linux.conf.au 2017 artwork.",
|
||||||
required = False,
|
required=False,
|
||||||
render_type=inv.Category.RENDER_TYPE_ITEM_QUANTITY,
|
render_type=inv.Category.RENDER_TYPE_ITEM_QUANTITY,
|
||||||
order=40,
|
order=40,
|
||||||
)
|
)
|
||||||
|
@ -124,7 +126,7 @@ class Command(BaseCommand):
|
||||||
"other hotels, including Wrest Point can be booked "
|
"other hotels, including Wrest Point can be booked "
|
||||||
"elsewhere. For full details, see [LINK]our "
|
"elsewhere. For full details, see [LINK]our "
|
||||||
"accommodation page.[/LINK]",
|
"accommodation page.[/LINK]",
|
||||||
required = False,
|
required=False,
|
||||||
render_type=inv.Category.RENDER_TYPE_RADIO,
|
render_type=inv.Category.RENDER_TYPE_RADIO,
|
||||||
limit_per_user=1,
|
limit_per_user=1,
|
||||||
order=50,
|
order=50,
|
||||||
|
@ -135,7 +137,7 @@ class Command(BaseCommand):
|
||||||
name="Extras",
|
name="Extras",
|
||||||
description="Other items that can improve your conference "
|
description="Other items that can improve your conference "
|
||||||
"experience.",
|
"experience.",
|
||||||
required = False,
|
required=False,
|
||||||
render_type=inv.Category.RENDER_TYPE_QUANTITY,
|
render_type=inv.Category.RENDER_TYPE_QUANTITY,
|
||||||
order=60,
|
order=60,
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
from django.conf import settings
|
|
||||||
from django.contrib.auth.decorators import login_required
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
|
||||||
from django.core.exceptions import ValidationError
|
from django.core.exceptions import ValidationError
|
||||||
from django.http import Http404
|
from django.http import Http404
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.shortcuts import redirect
|
from django.shortcuts import redirect
|
||||||
from django.shortcuts import render
|
|
||||||
|
|
||||||
from registrasion import models as rego
|
from registrasion import models as rego
|
||||||
from registrasion.controllers.invoice import InvoiceController
|
from registrasion.controllers.invoice import InvoiceController
|
||||||
|
@ -18,7 +14,7 @@ def demopay(request, invoice_id, access_code):
|
||||||
''' Marks the invoice with the given invoice id as paid.
|
''' Marks the invoice with the given invoice id as paid.
|
||||||
'''
|
'''
|
||||||
invoice_id = int(invoice_id)
|
invoice_id = int(invoice_id)
|
||||||
inv = get_object_or_404(rego.Invoice.objects,pk=invoice_id)
|
inv = get_object_or_404(rego.Invoice.objects, pk=invoice_id)
|
||||||
|
|
||||||
invoice = InvoiceController(inv)
|
invoice = InvoiceController(inv)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import os
|
import os
|
||||||
import dj_database_url
|
|
||||||
from django.utils.crypto import get_random_string
|
from django.utils.crypto import get_random_string
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +6,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir
|
||||||
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
|
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
|
||||||
BASE_DIR = PACKAGE_ROOT
|
BASE_DIR = PACKAGE_ROOT
|
||||||
|
|
||||||
DEBUG = True #bool(int(os.environ.get("DEBUG", "1")))
|
DEBUG = True # bool(int(os.environ.get("DEBUG", "1")))
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
|
@ -152,7 +151,7 @@ INSTALLED_APPS = [
|
||||||
"django_countries",
|
"django_countries",
|
||||||
"registripe",
|
"registripe",
|
||||||
|
|
||||||
#admin - required by registrasion ??
|
# admin - required by registrasion ??
|
||||||
"nested_admin",
|
"nested_admin",
|
||||||
|
|
||||||
# project
|
# project
|
||||||
|
@ -163,7 +162,7 @@ INSTALLED_APPS = [
|
||||||
"jquery",
|
"jquery",
|
||||||
"djangoformsetjs",
|
"djangoformsetjs",
|
||||||
|
|
||||||
#testing
|
# testing
|
||||||
"django_nose",
|
"django_nose",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -204,7 +203,7 @@ LOGGING = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'handlers': {
|
'handlers': {
|
||||||
'console':{
|
'console': {
|
||||||
'level': 'DEBUG',
|
'level': 'DEBUG',
|
||||||
'class': 'logging.StreamHandler',
|
'class': 'logging.StreamHandler',
|
||||||
'formatter': 'simple'
|
'formatter': 'simple'
|
||||||
|
@ -273,8 +272,8 @@ PROPOSAL_FORMS = {
|
||||||
"openhardware-miniconf": "pinaxcon.proposals.forms.OpenHardwareProposalForm",
|
"openhardware-miniconf": "pinaxcon.proposals.forms.OpenHardwareProposalForm",
|
||||||
}
|
}
|
||||||
|
|
||||||
#PINAX_PAGES_HOOKSET = "pinaxcon.hooks.PinaxPagesHookSet"
|
# PINAX_PAGES_HOOKSET = "pinaxcon.hooks.PinaxPagesHookSet"
|
||||||
#PINAX_BOXES_HOOKSET = "pinaxcon.hooks.PinaxBoxesHookSet"
|
# PINAX_BOXES_HOOKSET = "pinaxcon.hooks.PinaxBoxesHookSet"
|
||||||
|
|
||||||
# Registrasion bits:
|
# Registrasion bits:
|
||||||
ATTENDEE_PROFILE_MODEL = "pinaxcon.registrasion.models.AttendeeProfile"
|
ATTENDEE_PROFILE_MODEL = "pinaxcon.registrasion.models.AttendeeProfile"
|
||||||
|
@ -308,6 +307,6 @@ try:
|
||||||
LOCAL_SETTINGS
|
LOCAL_SETTINGS
|
||||||
except NameError:
|
except NameError:
|
||||||
try:
|
try:
|
||||||
from local_settings import *
|
from local_settings import * # noqa: F401,F403
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import cms_pages
|
import cms_pages
|
||||||
import hashlib
|
import hashlib
|
||||||
import urllib
|
|
||||||
|
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from django import template
|
from django import template
|
||||||
|
@ -55,7 +54,9 @@ def speaker_photo(context, speaker, size):
|
||||||
else:
|
else:
|
||||||
email = speaker.user.email.encode("utf-8")
|
email = speaker.user.email.encode("utf-8")
|
||||||
md5sum = hashlib.md5(email.strip().lower()).hexdigest()
|
md5sum = hashlib.md5(email.strip().lower()).hexdigest()
|
||||||
url = "https://secure.gravatar.com/avatar/%s?s=%d&d=%s" % (md5sum, size, "https://linux.conf.au/site_media/static/lca2017/images/speaker-fallback-devil.jpg")
|
fallback_image = ("https://linux.conf.au/site_media/static/lca2017"
|
||||||
|
"/images/speaker-fallback-devil.jpg")
|
||||||
|
url = "https://secure.gravatar.com/avatar/%s?s=%d&d=%s" % (md5sum, size, fallback_image)
|
||||||
|
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
@ -94,6 +95,7 @@ def gst(amount):
|
||||||
def conference_name():
|
def conference_name():
|
||||||
return conference_models.Conference.objects.get(id=CONFERENCE_ID).title
|
return conference_models.Conference.objects.get(id=CONFERENCE_ID).title
|
||||||
|
|
||||||
|
|
||||||
@register.filter()
|
@register.filter()
|
||||||
def trackname(room, day):
|
def trackname(room, day):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import cms_pages
|
import cms_pages
|
||||||
import hashlib
|
import hashlib
|
||||||
import urllib
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
@ -57,7 +56,9 @@ def speaker_photo(context, speaker, size):
|
||||||
else:
|
else:
|
||||||
email = speaker.user.email.encode("utf-8")
|
email = speaker.user.email.encode("utf-8")
|
||||||
md5sum = hashlib.md5(email.strip().lower()).hexdigest()
|
md5sum = hashlib.md5(email.strip().lower()).hexdigest()
|
||||||
url = "https://secure.gravatar.com/avatar/%s?s=%d&d=%s" % (md5sum, size, "https://2017.pycon-au.org/site_media/static/pyconau23017/images/speaker-fallback-devil.jpg")
|
fallback_image = ("https://2017.pycon-au.org/site_media/static"
|
||||||
|
"/pyconau23017/images/speaker-fallback-devil.jpg")
|
||||||
|
url = "https://secure.gravatar.com/avatar/%s?s=%d&d=%s" % (md5sum, size, fallback_image)
|
||||||
|
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ def gst(amount):
|
||||||
def conference_name():
|
def conference_name():
|
||||||
return conference_models.Conference.objects.get(id=CONFERENCE_ID).title
|
return conference_models.Conference.objects.get(id=CONFERENCE_ID).title
|
||||||
|
|
||||||
|
|
||||||
@register.filter()
|
@register.filter()
|
||||||
def trackname(room, day):
|
def trackname(room, day):
|
||||||
try:
|
try:
|
||||||
|
@ -104,11 +106,11 @@ def trackname(room, day):
|
||||||
track_name = None
|
track_name = None
|
||||||
return track_name
|
return track_name
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag()
|
@register.simple_tag()
|
||||||
def sponsor_thumbnail(sponsor_logo):
|
def sponsor_thumbnail(sponsor_logo):
|
||||||
if sponsor_logo is not None:
|
if sponsor_logo is not None:
|
||||||
if sponsor_logo.upload:
|
if sponsor_logo.upload:
|
||||||
logo_file = os.path.join(settings.MEDIA_URL, str(sponsor_logo.upload))
|
logo_file = os.path.join(settings.MEDIA_URL, str(sponsor_logo.upload))
|
||||||
return logo_file
|
return logo_file
|
||||||
|
|
||||||
return ""
|
return ""
|
|
@ -1,5 +1,5 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls import patterns, include, url
|
from django.conf.urls import include, url
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
|
@ -11,9 +11,6 @@ from django.contrib import admin
|
||||||
import symposion.views
|
import symposion.views
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r"^admin/", include(admin.site.urls)),
|
url(r"^admin/", include(admin.site.urls)),
|
||||||
|
|
||||||
|
@ -46,13 +43,13 @@ urlpatterns = [
|
||||||
url(r"^$", TemplateView.as_view(template_name="homepage.html"), name="home"),
|
url(r"^$", TemplateView.as_view(template_name="homepage.html"), name="home"),
|
||||||
|
|
||||||
# Demo payment gateway and related features
|
# Demo payment gateway and related features
|
||||||
#url(r"^register/pinaxcon/", include("pinaxcon.registrasion.urls")),
|
# url(r"^register/pinaxcon/", include("pinaxcon.registrasion.urls")),
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
import debug_toolbar
|
import debug_toolbar
|
||||||
urlpatterns.insert(0, url(r'^__debug__/', include(debug_toolbar.urls)))
|
urlpatterns.insert(0, url(r'^__debug__/', include(debug_toolbar.urls)))
|
||||||
|
|
||||||
|
|
||||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
|
|
||||||
|
|
||||||
class AceMarkdownEditor(forms.Textarea):
|
class AceMarkdownEditor(forms.Textarea):
|
||||||
|
|
||||||
def render(self, name, value, attrs):
|
def render(self, name, value, attrs):
|
||||||
|
|
Loading…
Reference in a new issue