run pre-commit --all-files, it's been a while since last time
This commit is contained in:
parent
a21bc1097c
commit
01687ea11a
|
@ -1,4 +1,5 @@
|
|||
from django import forms
|
||||
|
||||
from program.models import Event, Speaker
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.contrib.auth.mixins import UserPassesTestMixin
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.shortcuts import get_object_or_404
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from economy.models import Pos
|
||||
from utils.mixins import RaisePermissionRequiredMixin
|
||||
|
||||
|
|
|
@ -395,7 +395,9 @@ urlpatterns = [
|
|||
include(
|
||||
[
|
||||
path(
|
||||
"", SpeakerDetailView.as_view(), name="speaker_detail",
|
||||
"",
|
||||
SpeakerDetailView.as_view(),
|
||||
name="speaker_detail",
|
||||
),
|
||||
path(
|
||||
"update/",
|
||||
|
@ -473,7 +475,11 @@ urlpatterns = [
|
|||
"<slug:slug>/",
|
||||
include(
|
||||
[
|
||||
path("", EventDetailView.as_view(), name="event_detail",),
|
||||
path(
|
||||
"",
|
||||
EventDetailView.as_view(),
|
||||
name="event_detail",
|
||||
),
|
||||
path(
|
||||
"update/",
|
||||
EventUpdateView.as_view(),
|
||||
|
@ -500,7 +506,11 @@ urlpatterns = [
|
|||
"autoscheduler/",
|
||||
include(
|
||||
[
|
||||
path("", AutoScheduleManageView.as_view(), name="autoschedule_manage",),
|
||||
path(
|
||||
"",
|
||||
AutoScheduleManageView.as_view(),
|
||||
name="autoschedule_manage",
|
||||
),
|
||||
path(
|
||||
"crashcourse/",
|
||||
AutoScheduleCrashCourseView.as_view(),
|
||||
|
@ -512,7 +522,9 @@ urlpatterns = [
|
|||
name="autoschedule_validate",
|
||||
),
|
||||
path(
|
||||
"diff/", AutoScheduleDiffView.as_view(), name="autoschedule_diff",
|
||||
"diff/",
|
||||
AutoScheduleDiffView.as_view(),
|
||||
name="autoschedule_diff",
|
||||
),
|
||||
path(
|
||||
"apply/",
|
||||
|
@ -539,7 +551,11 @@ urlpatterns = [
|
|||
name="approve_event_feedback",
|
||||
),
|
||||
# add recording url objects
|
||||
path("add_recording", AddRecordingView.as_view(), name="add_eventrecording",),
|
||||
path(
|
||||
"add_recording",
|
||||
AddRecordingView.as_view(),
|
||||
name="add_eventrecording",
|
||||
),
|
||||
# economy
|
||||
path(
|
||||
"economy/",
|
||||
|
@ -658,18 +674,34 @@ urlpatterns = [
|
|||
"pos/",
|
||||
include(
|
||||
[
|
||||
path("", PosListView.as_view(), name="pos_list",),
|
||||
path("create/", PosCreateView.as_view(), name="pos_create",),
|
||||
path(
|
||||
"",
|
||||
PosListView.as_view(),
|
||||
name="pos_list",
|
||||
),
|
||||
path(
|
||||
"create/",
|
||||
PosCreateView.as_view(),
|
||||
name="pos_create",
|
||||
),
|
||||
path(
|
||||
"<slug:pos_slug>/",
|
||||
include(
|
||||
[
|
||||
path("", PosDetailView.as_view(), name="pos_detail",),
|
||||
path(
|
||||
"update/", PosUpdateView.as_view(), name="pos_update",
|
||||
"",
|
||||
PosDetailView.as_view(),
|
||||
name="pos_detail",
|
||||
),
|
||||
path(
|
||||
"delete/", PosDeleteView.as_view(), name="pos_delete",
|
||||
"update/",
|
||||
PosUpdateView.as_view(),
|
||||
name="pos_update",
|
||||
),
|
||||
path(
|
||||
"delete/",
|
||||
PosDeleteView.as_view(),
|
||||
name="pos_delete",
|
||||
),
|
||||
path(
|
||||
"reports/",
|
||||
|
@ -731,14 +763,30 @@ urlpatterns = [
|
|||
"tokens/",
|
||||
include(
|
||||
[
|
||||
path("", TokenListView.as_view(), name="token_list",),
|
||||
path("create/", TokenCreateView.as_view(), name="token_create",),
|
||||
path("stats/", TokenStatsView.as_view(), name="token_stats",),
|
||||
path(
|
||||
"",
|
||||
TokenListView.as_view(),
|
||||
name="token_list",
|
||||
),
|
||||
path(
|
||||
"create/",
|
||||
TokenCreateView.as_view(),
|
||||
name="token_create",
|
||||
),
|
||||
path(
|
||||
"stats/",
|
||||
TokenStatsView.as_view(),
|
||||
name="token_stats",
|
||||
),
|
||||
path(
|
||||
"<int:pk>/",
|
||||
include(
|
||||
[
|
||||
path("", TokenDetailView.as_view(), name="token_detail",),
|
||||
path(
|
||||
"",
|
||||
TokenDetailView.as_view(),
|
||||
name="token_detail",
|
||||
),
|
||||
path(
|
||||
"update/",
|
||||
TokenUpdateView.as_view(),
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
import logging
|
||||
|
||||
import requests
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.conf import settings
|
||||
from django.http import Http404, HttpResponse
|
||||
from django.views.generic import TemplateView
|
||||
from facilities.models import (
|
||||
FacilityFeedback,
|
||||
)
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from facilities.models import FacilityFeedback
|
||||
from teams.models import Team
|
||||
from utils.models import OutgoingEmail
|
||||
|
||||
from ..mixins import (
|
||||
RaisePermissionRequiredMixin,
|
||||
)
|
||||
from ..mixins import RaisePermissionRequiredMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
||||
class BackofficeIndexView(CampViewMixin, RaisePermissionRequiredMixin, TemplateView):
|
||||
"""
|
||||
The Backoffice index view only requires camps.backoffice_permission so we use RaisePermissionRequiredMixin directly
|
||||
|
@ -37,7 +35,14 @@ class BackofficeIndexView(CampViewMixin, RaisePermissionRequiredMixin, TemplateV
|
|||
)
|
||||
)
|
||||
)
|
||||
context["held_email_count"] = OutgoingEmail.objects.filter(hold=True, responsible_team__isnull=True).count() + OutgoingEmail.objects.filter(hold=True, responsible_team__camp=self.camp).count()
|
||||
context["held_email_count"] = (
|
||||
OutgoingEmail.objects.filter(
|
||||
hold=True, responsible_team__isnull=True
|
||||
).count()
|
||||
+ OutgoingEmail.objects.filter(
|
||||
hold=True, responsible_team__camp=self.camp
|
||||
).count()
|
||||
)
|
||||
return context
|
||||
|
||||
|
||||
|
|
|
@ -1,24 +1,16 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.forms import modelformset_factory
|
||||
from django.shortcuts import redirect
|
||||
from django.urls import reverse
|
||||
from django.views.generic.edit import FormView
|
||||
from program.models import (
|
||||
Event,
|
||||
EventFeedback,
|
||||
Url,
|
||||
UrlType,
|
||||
)
|
||||
|
||||
from ..forms import (
|
||||
AddRecordingForm,
|
||||
)
|
||||
from ..mixins import (
|
||||
ContentTeamPermissionMixin,
|
||||
)
|
||||
from camps.mixins import CampViewMixin
|
||||
from program.models import Event, EventFeedback, Url, UrlType
|
||||
|
||||
from ..forms import AddRecordingForm
|
||||
from ..mixins import ContentTeamPermissionMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
@ -84,9 +76,7 @@ class AddRecordingView(CampViewMixin, ContentTeamPermissionMixin, FormView):
|
|||
super().setup(*args, **kwargs)
|
||||
self.queryset = Event.objects.filter(
|
||||
track__camp=self.camp, video_recording=True
|
||||
).exclude(
|
||||
urls__url_type__name="Recording"
|
||||
)
|
||||
).exclude(urls__url_type__name="Recording")
|
||||
|
||||
self.form_class = modelformset_factory(
|
||||
Event,
|
||||
|
@ -113,19 +103,17 @@ class AddRecordingView(CampViewMixin, ContentTeamPermissionMixin, FormView):
|
|||
form.save()
|
||||
|
||||
for event_data in form.cleaned_data:
|
||||
if event_data['recording_url']:
|
||||
url = event_data['recording_url']
|
||||
if not event_data['id'].urls.filter(url=url).exists():
|
||||
if event_data["recording_url"]:
|
||||
url = event_data["recording_url"]
|
||||
if not event_data["id"].urls.filter(url=url).exists():
|
||||
recording_url = Url()
|
||||
recording_url.event = event_data['id']
|
||||
recording_url.event = event_data["id"]
|
||||
recording_url.url = url
|
||||
recording_url.url_type = UrlType.objects.get(name="Recording")
|
||||
recording_url.save()
|
||||
|
||||
if form.changed_objects:
|
||||
messages.success(
|
||||
self.request, f"Updated {len(form.changed_objects)} Event"
|
||||
)
|
||||
messages.success(self.request, f"Updated {len(form.changed_objects)} Event")
|
||||
return redirect(self.get_success_url())
|
||||
|
||||
def get_success_url(self, *args, **kwargs):
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import logging
|
||||
import os
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.models import User
|
||||
|
@ -12,18 +11,12 @@ from django.urls import reverse
|
|||
from django.utils import timezone
|
||||
from django.views.generic import DetailView, ListView
|
||||
from django.views.generic.edit import CreateView, DeleteView, UpdateView
|
||||
from economy.models import (
|
||||
Chain,
|
||||
Credebtor,
|
||||
Expense,
|
||||
Reimbursement,
|
||||
Revenue,
|
||||
)
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from economy.models import Chain, Credebtor, Expense, Reimbursement, Revenue
|
||||
from teams.models import Team
|
||||
|
||||
from ..mixins import (
|
||||
EconomyTeamPermissionMixin,
|
||||
)
|
||||
from ..mixins import EconomyTeamPermissionMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
@ -448,5 +441,3 @@ class RevenueDetailView(CampViewMixin, EconomyTeamPermissionMixin, UpdateView):
|
|||
return redirect(
|
||||
reverse("backoffice:revenue_list", kwargs={"camp_slug": self.camp.slug})
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.core.exceptions import PermissionDenied
|
||||
|
@ -9,19 +8,18 @@ from django.shortcuts import get_object_or_404, redirect
|
|||
from django.urls import reverse
|
||||
from django.views.generic import DetailView, ListView
|
||||
from django.views.generic.edit import CreateView, DeleteView, FormView, UpdateView
|
||||
from leaflet.forms.widgets import LeafletWidget
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from facilities.models import (
|
||||
Facility,
|
||||
FacilityFeedback,
|
||||
FacilityOpeningHours,
|
||||
FacilityType,
|
||||
)
|
||||
from leaflet.forms.widgets import LeafletWidget
|
||||
from teams.models import Team
|
||||
|
||||
from ..mixins import (
|
||||
OrgaTeamPermissionMixin,
|
||||
RaisePermissionRequiredMixin,
|
||||
)
|
||||
from ..mixins import OrgaTeamPermissionMixin, RaisePermissionRequiredMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
@ -320,5 +318,3 @@ class FacilityOpeningHoursDeleteView(
|
|||
"backoffice:facility_detail",
|
||||
kwargs={"camp_slug": self.camp.slug, "facility_uuid": self.facility.pk},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.models import User
|
||||
from django.db.models import Count, Q
|
||||
|
@ -8,11 +7,11 @@ from django.shortcuts import redirect
|
|||
from django.urls import reverse
|
||||
from django.views.generic import DetailView, ListView
|
||||
from django.views.generic.edit import CreateView, DeleteView, UpdateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from tokens.models import Token, TokenFind
|
||||
|
||||
from ..mixins import (
|
||||
RaisePermissionRequiredMixin,
|
||||
)
|
||||
from ..mixins import RaisePermissionRequiredMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import logging
|
||||
from itertools import chain
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import ListView, TemplateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from shop.models import Order, OrderProductRelation
|
||||
from tickets.models import DiscountTicket, ShopTicket, SponsorTicket, TicketType
|
||||
|
||||
from ..mixins import (
|
||||
InfoTeamPermissionMixin,
|
||||
)
|
||||
from ..mixins import InfoTeamPermissionMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
@ -140,7 +139,9 @@ class ScanTicketsView(
|
|||
messages.success(request, "Order #{} has been marked as paid!".format(order.id))
|
||||
|
||||
|
||||
class ShopTicketOverview(LoginRequiredMixin, InfoTeamPermissionMixin, CampViewMixin, ListView):
|
||||
class ShopTicketOverview(
|
||||
LoginRequiredMixin, InfoTeamPermissionMixin, CampViewMixin, ListView
|
||||
):
|
||||
model = ShopTicket
|
||||
template_name = "shop_ticket_overview.html"
|
||||
context_object_name = "shop_tickets"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.forms import modelformset_factory
|
||||
from django.shortcuts import redirect
|
||||
|
@ -8,13 +7,13 @@ from django.urls import reverse
|
|||
from django.utils import timezone
|
||||
from django.views.generic import ListView, TemplateView
|
||||
from django.views.generic.edit import FormView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from profiles.models import Profile
|
||||
from shop.models import OrderProductRelation
|
||||
from utils.models import OutgoingEmail
|
||||
|
||||
from ..mixins import (
|
||||
OrgaTeamPermissionMixin,
|
||||
)
|
||||
from ..mixins import OrgaTeamPermissionMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
@ -28,6 +27,7 @@ class ApproveNamesView(CampViewMixin, OrgaTeamPermissionMixin, ListView):
|
|||
public_credit_name=""
|
||||
)
|
||||
|
||||
|
||||
################################
|
||||
# MERCHANDISE VIEWS
|
||||
|
||||
|
|
|
@ -1,23 +1,17 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.shortcuts import redirect
|
||||
from django.urls import reverse
|
||||
from django.views.generic import DetailView, ListView
|
||||
from django.views.generic.edit import CreateView, DeleteView, UpdateView
|
||||
from economy.models import (
|
||||
Pos,
|
||||
PosReport,
|
||||
)
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from economy.models import Pos, PosReport
|
||||
from teams.models import Team
|
||||
|
||||
from ..mixins import (
|
||||
OrgaTeamPermissionMixin,
|
||||
PosViewMixin,
|
||||
RaisePermissionRequiredMixin,
|
||||
)
|
||||
from ..mixins import OrgaTeamPermissionMixin, PosViewMixin, RaisePermissionRequiredMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
|
@ -10,6 +9,8 @@ from django.urls import reverse
|
|||
from django.utils.safestring import mark_safe
|
||||
from django.views.generic import DetailView, ListView, TemplateView
|
||||
from django.views.generic.edit import CreateView, DeleteView, FormView, UpdateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from program.autoscheduler import AutoScheduler
|
||||
from program.mixins import AvailabilityMatrixViewMixin
|
||||
from program.models import (
|
||||
|
@ -30,9 +31,7 @@ from ..forms import (
|
|||
EventScheduleForm,
|
||||
SpeakerForm,
|
||||
)
|
||||
from ..mixins import (
|
||||
ContentTeamPermissionMixin,
|
||||
)
|
||||
from ..mixins import ContentTeamPermissionMixin
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.db import models
|
||||
|
||||
from utils.models import CampRelatedModel
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.views.generic import ListView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from .models import ProductCategory
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from channels.auth import AuthMiddlewareStack
|
||||
from channels.routing import ProtocolTypeRouter, URLRouter
|
||||
from django.conf.urls import url
|
||||
|
||||
from program.consumers import ScheduleConsumer
|
||||
|
||||
application = ProtocolTypeRouter(
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from camps.models import Camp
|
||||
from graphene import ObjectType, Schema, relay
|
||||
from graphene_django import DjangoObjectType
|
||||
from graphene_django.filter import DjangoFilterConnectionField
|
||||
|
||||
from camps.models import Camp
|
||||
from program.schema import ProgramQuery
|
||||
|
||||
|
||||
|
|
|
@ -203,4 +203,4 @@ DATA_UPLOAD_MAX_NUMBER_FIELDS = 5000
|
|||
ACCOUNT_SIGNUP_FORM_CLASS = "bornhack.forms.AllAuthSignupCaptchaForm"
|
||||
|
||||
# django 3.2 https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
from allauth.account.views import LoginView, LogoutView
|
||||
from bar.views import MenuView
|
||||
from camps.views import CampDetailView, CampListView, CampRedirectView
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.urls import path
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from bar.views import MenuView
|
||||
from camps.views import CampDetailView, CampListView, CampRedirectView
|
||||
from feedback.views import FeedbackCreate
|
||||
from info.views import CampInfoView
|
||||
from people.views import PeopleView
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.models import Camp
|
||||
from django.shortcuts import get_object_or_404
|
||||
|
||||
from camps.models import Camp
|
||||
|
||||
|
||||
class CampViewMixin:
|
||||
"""
|
||||
|
|
|
@ -8,6 +8,7 @@ from django.db import models
|
|||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from psycopg2.extras import DateTimeTZRange
|
||||
|
||||
from utils.models import CreatedUpdatedModel, UUIDModel
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from camps.models import Camp
|
||||
from django.contrib import admin
|
||||
from django.utils import timezone
|
||||
|
||||
from camps.models import Camp
|
||||
|
||||
|
||||
def get_current_camp():
|
||||
try:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from teams.models import Team
|
||||
from utils.email import add_outgoing_email
|
||||
|
||||
|
|
|
@ -53,7 +53,9 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"ordering": ["name"],},
|
||||
options={
|
||||
"ordering": ["name"],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="PosReport",
|
||||
|
@ -279,6 +281,8 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"abstract": False,},
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
|
@ -11,6 +11,7 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="posreport", options={"ordering": ["date", "pos"]},
|
||||
name="posreport",
|
||||
options={"ordering": ["date", "pos"]},
|
||||
),
|
||||
]
|
||||
|
|
|
@ -4,6 +4,7 @@ from django.contrib import messages
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
|
||||
from utils.models import CampRelatedModel, CreatedUpdatedModel, UUIDModel
|
||||
from utils.slugs import unique_slugify
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import os
|
||||
|
||||
import magic
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
@ -16,6 +15,8 @@ from django.views.generic import (
|
|||
TemplateView,
|
||||
UpdateView,
|
||||
)
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from teams.models import Team
|
||||
from utils.email import add_outgoing_email
|
||||
from utils.mixins import RaisePermissionRequiredMixin
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.db import models
|
||||
|
||||
from teams.models import Team
|
||||
from utils.models import CreatedUpdatedModel
|
||||
|
||||
|
|
|
@ -42,7 +42,9 @@ class Migration(migrations.Migration):
|
|||
models.TextField(help_text="Description of this facility"),
|
||||
),
|
||||
],
|
||||
options={"abstract": False,},
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="FacilityQuickFeedback",
|
||||
|
@ -124,7 +126,9 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"unique_together": {("slug", "responsible_team")},},
|
||||
options={
|
||||
"unique_together": {("slug", "responsible_team")},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="FacilityFeedback",
|
||||
|
@ -202,7 +206,9 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"abstract": False,},
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="facility",
|
||||
|
|
|
@ -50,6 +50,8 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"abstract": False,},
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
|
@ -14,7 +14,8 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="facilityopeninghours", options={"ordering": ["when"]},
|
||||
name="facilityopeninghours",
|
||||
options={"ordering": ["when"]},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="facility",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.shortcuts import get_object_or_404
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from .models import Facility, FacilityType
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ from django.contrib.postgres.constraints import ExclusionConstraint
|
|||
from django.contrib.postgres.fields import DateTimeRangeField, RangeOperators
|
||||
from django.db import models
|
||||
from django.shortcuts import reverse
|
||||
|
||||
from maps.utils import LeafletMarkerChoices
|
||||
from utils.models import CampRelatedModel, UUIDModel
|
||||
from utils.slugs import unique_slugify
|
||||
|
@ -111,7 +112,8 @@ class Facility(CampRelatedModel, UUIDModel):
|
|||
)
|
||||
|
||||
name = models.CharField(
|
||||
max_length=100, help_text="Name or description of this facility",
|
||||
max_length=100,
|
||||
help_text="Name or description of this facility",
|
||||
)
|
||||
|
||||
description = models.TextField(help_text="Description of this facility")
|
||||
|
@ -250,7 +252,8 @@ class FacilityOpeningHours(CampRelatedModel):
|
|||
)
|
||||
|
||||
when = DateTimeRangeField(
|
||||
db_index=True, help_text="The period when this facility is open.",
|
||||
db_index=True,
|
||||
help_text="The period when this facility is open.",
|
||||
)
|
||||
|
||||
notes = models.TextField(
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django import forms
|
||||
from django.contrib import messages
|
||||
from django.shortcuts import redirect
|
||||
|
@ -6,6 +5,8 @@ from django.urls import reverse
|
|||
from django.views.generic import DetailView, ListView
|
||||
from django.views.generic.edit import CreateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from .mixins import FacilityTypeViewMixin, FacilityViewMixin
|
||||
from .models import Facility, FacilityFeedback, FacilityType
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.db import models
|
||||
|
||||
from utils.models import CampRelatedModel, UUIDModel
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.urls import reverse
|
||||
from django.views.generic import CreateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from tokens.models import Token
|
||||
|
||||
from .models import Feedback
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import reversion
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
|
||||
from utils.models import CampRelatedModel
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.views.generic import ListView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from .models import InfoCategory
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import irc3
|
|||
from asgiref.sync import sync_to_async
|
||||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
|
||||
from ircbot.models import OutgoingIrcMessage
|
||||
from teams.models import Team, TeamMember
|
||||
from teams.utils import get_team_from_irc_channel
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
|
||||
from utils.models import CreatedUpdatedModel
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.utils.text import slugify
|
||||
|
||||
from utils.models import CreatedUpdatedModel
|
||||
from utils.slugs import unique_slugify
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.models import Camp
|
||||
from django.views.generic import ListView
|
||||
|
||||
from camps.models import Camp
|
||||
|
||||
|
||||
class PeopleView(ListView):
|
||||
template_name = "people.html"
|
||||
|
|
|
@ -82,6 +82,8 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"unique_together": {("camp", "number")},},
|
||||
options={
|
||||
"unique_together": {("camp", "number")},
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
|
@ -3,6 +3,7 @@ import logging
|
|||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
|
||||
from utils.models import CampRelatedModel
|
||||
|
||||
from .dectutils import DectUtils
|
||||
|
@ -20,7 +21,9 @@ class DectRegistration(CampRelatedModel):
|
|||
unique_together = [("camp", "number")]
|
||||
|
||||
camp = models.ForeignKey(
|
||||
"camps.Camp", related_name="dect_registrations", on_delete=models.PROTECT,
|
||||
"camps.Camp",
|
||||
related_name="dect_registrations",
|
||||
on_delete=models.PROTECT,
|
||||
)
|
||||
|
||||
user = models.ForeignKey(
|
||||
|
@ -47,11 +50,14 @@ class DectRegistration(CampRelatedModel):
|
|||
)
|
||||
|
||||
activation_code = models.CharField(
|
||||
max_length=10, blank=True, help_text="The 10 digit numeric activation code",
|
||||
max_length=10,
|
||||
blank=True,
|
||||
help_text="The 10 digit numeric activation code",
|
||||
)
|
||||
|
||||
publish_in_phonebook = models.BooleanField(
|
||||
default=True, help_text="Check to list this registration in the phonebook",
|
||||
default=True,
|
||||
help_text="Check to list this registration in the phonebook",
|
||||
)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
|
|
|
@ -3,7 +3,6 @@ import logging
|
|||
import secrets
|
||||
import string
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.core.exceptions import ValidationError
|
||||
|
@ -13,6 +12,8 @@ from django.urls import reverse
|
|||
from django.utils import timezone
|
||||
from django.views.generic import CreateView, DeleteView, ListView, UpdateView
|
||||
from oauth2_provider.views.generic import ProtectedResourceView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from utils.mixins import RaisePermissionRequiredMixin, UserIsObjectOwnerMixin
|
||||
|
||||
from .mixins import DectRegistrationViewMixin
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from utils.models import CreatedUpdatedModel, UUIDModel
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ class ProgramConfig(AppConfig):
|
|||
name = "program"
|
||||
|
||||
def ready(self):
|
||||
from .models import Speaker, EventSession
|
||||
from .models import EventSession, Speaker
|
||||
from .signal_handlers import (
|
||||
check_speaker_event_camp_consistency,
|
||||
event_session_post_save,
|
||||
|
|
|
@ -320,7 +320,10 @@ class AutoScheduler:
|
|||
This method returns a dict of Event differences and Slot differences between
|
||||
the two schedules.
|
||||
"""
|
||||
slot_diff = scheduler.slot_schedule_difference(original_schedule, new_schedule,)
|
||||
slot_diff = scheduler.slot_schedule_difference(
|
||||
original_schedule,
|
||||
new_schedule,
|
||||
)
|
||||
|
||||
slot_output = []
|
||||
for item in slot_diff:
|
||||
|
@ -347,7 +350,8 @@ class AutoScheduler:
|
|||
|
||||
# then get a list of differences per event
|
||||
event_diff = scheduler.event_schedule_difference(
|
||||
original_schedule, new_schedule,
|
||||
original_schedule,
|
||||
new_schedule,
|
||||
)
|
||||
event_output = []
|
||||
# loop over the differences and build the dict
|
||||
|
@ -357,7 +361,11 @@ class AutoScheduler:
|
|||
except self.camp.events.DoesNotExist:
|
||||
event = item.event.name
|
||||
event_output.append(
|
||||
{"event": event, "old": {}, "new": {},}
|
||||
{
|
||||
"event": event,
|
||||
"old": {},
|
||||
"new": {},
|
||||
}
|
||||
)
|
||||
# do we have an old slot for this event?
|
||||
if item.old_slot:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.models import Camp
|
||||
from channels.generic.websocket import JsonWebsocketConsumer
|
||||
|
||||
from camps.models import Camp
|
||||
|
||||
from .models import (
|
||||
Event,
|
||||
EventInstance,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import logging
|
||||
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
|
||||
from teams.models import Team
|
||||
from utils.email import add_outgoing_email
|
||||
|
||||
|
|
|
@ -33,7 +33,8 @@ class SpeakerProposalForm(forms.ModelForm):
|
|||
|
||||
# only show events from this camp
|
||||
self.fields["event_conflicts"].queryset = Event.objects.filter(
|
||||
track__camp=camp, event_type__support_speaker_event_conflicts=True,
|
||||
track__camp=camp,
|
||||
event_type__support_speaker_event_conflicts=True,
|
||||
)
|
||||
|
||||
if matrix:
|
||||
|
@ -267,7 +268,7 @@ class EventProposalForm(forms.ModelForm):
|
|||
def clean_duration(self):
|
||||
"""Make sure duration has been specified, and make sure it is not too long"""
|
||||
if not self.cleaned_data["duration"]:
|
||||
raise forms.ValidationError(f"Please specify a duration.")
|
||||
raise forms.ValidationError("Please specify a duration.")
|
||||
if (
|
||||
self.event_type.event_duration_minutes
|
||||
and self.cleaned_data["duration"] > self.event_type.event_duration_minutes
|
||||
|
|
|
@ -2,10 +2,11 @@ import logging
|
|||
from datetime import timedelta
|
||||
from time import sleep
|
||||
|
||||
from camps.utils import get_current_camp
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
|
||||
from camps.utils import get_current_camp
|
||||
from ircbot.models import OutgoingIrcMessage
|
||||
from program.models import EventInstance
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
# Generated by Django 1.10.5 on 2017-02-18 11:43
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import program.models
|
||||
from django.db import migrations, models
|
||||
|
||||
import program.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
|
|
@ -5,10 +5,11 @@ from __future__ import unicode_literals
|
|||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
import program.models
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
import program.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
|
|
@ -5,10 +5,11 @@ from __future__ import unicode_literals
|
|||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
import program.models
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
import program.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
# Generated by Django 1.10.5 on 2017-03-14 19:12
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import program.models
|
||||
from django.db import migrations, models
|
||||
|
||||
import program.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
# Generated by Django 1.10.5 on 2017-03-15 23:04
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import program.models
|
||||
from django.db import migrations, models
|
||||
|
||||
import program.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name="eventfeedback", unique_together={("user", "event")},
|
||||
name="eventfeedback",
|
||||
unique_together={("user", "event")},
|
||||
),
|
||||
]
|
||||
|
|
|
@ -11,6 +11,8 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name="eventfeedback", old_name="feedback", new_name="comment",
|
||||
model_name="eventfeedback",
|
||||
old_name="feedback",
|
||||
new_name="comment",
|
||||
),
|
||||
]
|
||||
|
|
|
@ -51,7 +51,9 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"ordering": ["when", "event_type", "event_location"],},
|
||||
options={
|
||||
"ordering": ["when", "event_type", "event_location"],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="EventSlot",
|
||||
|
@ -81,7 +83,9 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={"ordering": ["when"],},
|
||||
options={
|
||||
"ordering": ["when"],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="SpeakerAvailability",
|
||||
|
@ -128,7 +132,9 @@ class Migration(migrations.Migration):
|
|||
("created", models.DateTimeField(auto_now_add=True)),
|
||||
("updated", models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={"abstract": False,},
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="SpeakerProposalAvailability",
|
||||
|
@ -175,7 +181,9 @@ class Migration(migrations.Migration):
|
|||
("created", models.DateTimeField(auto_now_add=True)),
|
||||
("updated", models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={"abstract": False,},
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="event",
|
||||
|
|
|
@ -32,13 +32,19 @@ class Migration(migrations.Migration):
|
|||
new_name="speaker_proposal",
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="url", old_name="eventproposal", new_name="event_proposal",
|
||||
model_name="url",
|
||||
old_name="eventproposal",
|
||||
new_name="event_proposal",
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="url", old_name="speakerproposal", new_name="speaker_proposal",
|
||||
model_name="url",
|
||||
old_name="speakerproposal",
|
||||
new_name="speaker_proposal",
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name="url", old_name="urltype", new_name="url_type",
|
||||
model_name="url",
|
||||
old_name="urltype",
|
||||
new_name="url_type",
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="event",
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
import django.contrib.postgres.constraints
|
||||
import django.db.models.deletion
|
||||
import utils.database
|
||||
from django.db import migrations, models
|
||||
|
||||
import utils.database
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
@ -13,13 +14,21 @@ class Migration(migrations.Migration):
|
|||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(model_name="speakereventconflict", name="events",),
|
||||
migrations.RemoveField(model_name="speakereventconflict", name="speaker",),
|
||||
migrations.RemoveField(
|
||||
model_name="speakerproposaleventconflict", name="events",
|
||||
model_name="speakereventconflict",
|
||||
name="events",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="speakerproposaleventconflict", name="speaker_proposal",
|
||||
model_name="speakereventconflict",
|
||||
name="speaker",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="speakerproposaleventconflict",
|
||||
name="events",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="speakerproposaleventconflict",
|
||||
name="speaker_proposal",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="eventtype",
|
||||
|
@ -110,6 +119,10 @@ class Migration(migrations.Migration):
|
|||
name="prevent_speaker_proposal_availability_adjacent_mergeable",
|
||||
),
|
||||
),
|
||||
migrations.DeleteModel(name="SpeakerEventConflict",),
|
||||
migrations.DeleteModel(name="SpeakerProposalEventConflict",),
|
||||
migrations.DeleteModel(
|
||||
name="SpeakerEventConflict",
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="SpeakerProposalEventConflict",
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.http import Http404
|
||||
from django.shortcuts import get_object_or_404, redirect
|
||||
from django.urls import reverse
|
||||
from django.views.generic.detail import SingleObjectMixin
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from program.utils import (
|
||||
add_existing_availability_to_matrix,
|
||||
get_speaker_availability_form_matrix,
|
||||
|
@ -141,7 +142,9 @@ class EventFeedbackViewMixin(EventViewMixin):
|
|||
def setup(self, *args, **kwargs):
|
||||
super().setup(*args, **kwargs)
|
||||
self.event_feedback = get_object_or_404(
|
||||
models.EventFeedback, event=self.event, user=self.request.user,
|
||||
models.EventFeedback,
|
||||
event=self.event,
|
||||
user=self.request.user,
|
||||
)
|
||||
|
||||
def get_object(self):
|
||||
|
|
|
@ -18,6 +18,7 @@ from django.utils import timezone
|
|||
from django.utils.safestring import mark_safe
|
||||
from psycopg2.extras import DateTimeTZRange
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
from utils.database import CastToInteger
|
||||
from utils.models import (
|
||||
CampRelatedModel,
|
||||
|
@ -290,7 +291,9 @@ class SpeakerAvailability(Availability):
|
|||
def clean(self):
|
||||
# this should be an ExclusionConstraint but the boolean condition isn't conditioning :/
|
||||
if SpeakerAvailability.objects.filter(
|
||||
speaker=self.speaker, when__adjacent_to=self.when, available=self.available,
|
||||
speaker=self.speaker,
|
||||
when__adjacent_to=self.when,
|
||||
available=self.available,
|
||||
).exists():
|
||||
raise ValidationError(
|
||||
"An adjacent SpeakerAvailability object for this Speaker already exists with the same value for available, cannot save()"
|
||||
|
@ -538,7 +541,10 @@ class EventProposal(UserSubmittedModel):
|
|||
help_text="Will you be using the provided speaker laptop?", default=True
|
||||
)
|
||||
|
||||
tags = TaggableManager(through=UUIDTaggedItem, blank=True,)
|
||||
tags = TaggableManager(
|
||||
through=UUIDTaggedItem,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
@property
|
||||
def camp(self):
|
||||
|
@ -785,7 +791,8 @@ class EventType(CreatedUpdatedModel):
|
|||
)
|
||||
|
||||
support_autoscheduling = models.BooleanField(
|
||||
default=False, help_text="Check to enable this EventType in the autoscheduler",
|
||||
default=False,
|
||||
help_text="Check to enable this EventType in the autoscheduler",
|
||||
)
|
||||
|
||||
support_speaker_event_conflicts = models.BooleanField(
|
||||
|
@ -891,7 +898,8 @@ class EventSession(CampRelatedModel):
|
|||
)
|
||||
|
||||
description = models.TextField(
|
||||
blank=True, help_text="Description of this session (optional).",
|
||||
blank=True,
|
||||
help_text="Description of this session (optional).",
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
|
@ -957,7 +965,8 @@ class EventSession(CampRelatedModel):
|
|||
"""Return a list of slots that are not available for some reason"""
|
||||
return self.event_slots.exclude(
|
||||
id__in=self.get_available_slots(
|
||||
count_autoscheduled_as_free=count_autoscheduled_as_free, bounds=bounds,
|
||||
count_autoscheduled_as_free=count_autoscheduled_as_free,
|
||||
bounds=bounds,
|
||||
).values_list("id", flat=True),
|
||||
)
|
||||
|
||||
|
@ -1036,7 +1045,9 @@ class EventSlot(CampRelatedModel):
|
|||
help_text="The EventSession this EventSlot belongs to",
|
||||
)
|
||||
|
||||
when = DateTimeRangeField(help_text="Start and end time of this slot",)
|
||||
when = DateTimeRangeField(
|
||||
help_text="Start and end time of this slot",
|
||||
)
|
||||
|
||||
event = models.ForeignKey(
|
||||
"program.Event",
|
||||
|
@ -1362,7 +1373,8 @@ class EventInstance(CampRelatedModel):
|
|||
)
|
||||
|
||||
autoscheduled = models.BooleanField(
|
||||
default=False, help_text="True if this was created by the autoscheduler.",
|
||||
default=False,
|
||||
help_text="True if this was created by the autoscheduler.",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -1638,7 +1650,8 @@ class EventFeedback(CampRelatedModel, UUIDModel):
|
|||
)
|
||||
|
||||
expectations_fulfilled = models.BooleanField(
|
||||
choices=YESNO_CHOICES, help_text="Did the event live up to your expectations?",
|
||||
choices=YESNO_CHOICES,
|
||||
help_text="Did the event live up to your expectations?",
|
||||
)
|
||||
|
||||
attend_speaker_again = models.BooleanField(
|
||||
|
@ -1649,7 +1662,8 @@ class EventFeedback(CampRelatedModel, UUIDModel):
|
|||
RATING_CHOICES = [(n, f"{n}") for n in range(0, 6)]
|
||||
|
||||
rating = models.IntegerField(
|
||||
choices=RATING_CHOICES, help_text="Rating/Score (5 is best)",
|
||||
choices=RATING_CHOICES,
|
||||
help_text="Rating/Score (5 is best)",
|
||||
)
|
||||
|
||||
comment = models.TextField(blank=True, help_text="Any other comments or feedback?")
|
||||
|
@ -1682,15 +1696,12 @@ class CustomUrlStorage(FileSystemStorage):
|
|||
Can be removed when we clean up old migrations at some point
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
def get_speaker_picture_upload_path():
|
||||
"""
|
||||
Must exist because it is mentioned in old migrations.
|
||||
Can be removed when we clean up old migrations at some point
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def get_speakerproposal_picture_upload_path():
|
||||
|
@ -1698,7 +1709,6 @@ def get_speakerproposal_picture_upload_path():
|
|||
Must exist because it is mentioned in old migrations.
|
||||
Can be removed when we clean up old migrations at some point
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def get_speakersubmission_picture_upload_path():
|
||||
|
@ -1706,4 +1716,3 @@ def get_speakersubmission_picture_upload_path():
|
|||
Must exist because it is mentioned in old migrations.
|
||||
Can be removed when we clean up old migrations at some point
|
||||
"""
|
||||
pass
|
||||
|
|
|
@ -50,7 +50,8 @@ class MultiForm(object):
|
|||
# Some things, such as the WizardView expect these to exist.
|
||||
self.data, self.files = data, files
|
||||
kwargs.update(
|
||||
data=data, files=files,
|
||||
data=data,
|
||||
files=files,
|
||||
)
|
||||
|
||||
self.initials = kwargs.pop("initial", None)
|
||||
|
@ -74,7 +75,8 @@ class MultiForm(object):
|
|||
else:
|
||||
prefix = "{0}__{1}".format(key, prefix)
|
||||
fkwargs.update(
|
||||
initial=self.initials.get(key), prefix=prefix,
|
||||
initial=self.initials.get(key),
|
||||
prefix=prefix,
|
||||
)
|
||||
return args, fkwargs
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ logger = logging.getLogger("bornhack.%s" % __name__)
|
|||
|
||||
def check_speaker_event_camp_consistency(sender, instance, **kwargs):
|
||||
if kwargs["action"] == "pre_add":
|
||||
from program.models import Speaker, Event
|
||||
from program.models import Event, Speaker
|
||||
|
||||
if isinstance(instance, Event):
|
||||
# loop over speakers being added to this event
|
||||
|
|
|
@ -32,7 +32,7 @@ def availabilitytable(matrix, form=None):
|
|||
# start bulding the output
|
||||
output = "<div class='form-group'>"
|
||||
output += "<table class='table table-hover table-condensed table-bordered table-responsive' style='margin-bottom: .25em;'><thead>"
|
||||
output += f"<tr><th class='text-nowrap'>Speaker Availability</th>"
|
||||
output += "<tr><th class='text-nowrap'>Speaker Availability</th>"
|
||||
|
||||
# to build the <thead> for this table we need to loop over the days (dates)
|
||||
# in the matrix and create a column for each
|
||||
|
|
|
@ -93,7 +93,11 @@ def get_speaker_availability_form_matrix(sessions):
|
|||
# pass a list of dicts instead of the queryset to avoid one million lookups
|
||||
for et in event_types:
|
||||
matrix[day][daychunk]["event_types"].append(
|
||||
{"name": et.name, "icon": et.icon, "color": et.color,}
|
||||
{
|
||||
"name": et.name,
|
||||
"icon": et.icon,
|
||||
"color": et.color,
|
||||
}
|
||||
)
|
||||
matrix[day][daychunk]["initial"] = None
|
||||
else:
|
||||
|
@ -205,7 +209,9 @@ def save_speaker_availability(form, obj):
|
|||
else:
|
||||
# "available" changed or daychunk is not adjacent to formerchunk
|
||||
AvailabilityModel.objects.create(
|
||||
when=formerchunk, available=formeravailable, **kwargs,
|
||||
when=formerchunk,
|
||||
available=formeravailable,
|
||||
**kwargs,
|
||||
)
|
||||
# and remember the current chunk for next iteration
|
||||
formerchunk = daychunk
|
||||
|
|
|
@ -2,7 +2,6 @@ import logging
|
|||
from collections import OrderedDict
|
||||
|
||||
import icalendar
|
||||
from camps.mixins import CampViewMixin
|
||||
from django import forms
|
||||
from django.contrib import messages
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
|
@ -15,6 +14,8 @@ from django.utils.decorators import method_decorator
|
|||
from django.views.generic import DetailView, ListView, TemplateView, View
|
||||
from django.views.generic.edit import CreateView, DeleteView, UpdateView
|
||||
from lxml import etree, objectify
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from utils.middleware import RedirectException
|
||||
from utils.mixins import UserIsObjectOwnerMixin
|
||||
|
||||
|
@ -82,7 +83,8 @@ class ICSView(CampViewMixin, View):
|
|||
query_kwargs["event__video_recording"] = False
|
||||
|
||||
event_slots = models.EventSlot.objects.filter(
|
||||
event__track__camp=self.camp, **query_kwargs,
|
||||
event__track__camp=self.camp,
|
||||
**query_kwargs,
|
||||
).prefetch_related("event", "event_session__event_location")
|
||||
|
||||
cal = icalendar.Calendar()
|
||||
|
@ -295,7 +297,7 @@ class SpeakerProposalUpdateView(
|
|||
# message user and redirect
|
||||
messages.info(
|
||||
self.request,
|
||||
f"Changes to your proposal is now pending approval by the content team.",
|
||||
"Changes to your proposal is now pending approval by the content team.",
|
||||
)
|
||||
return redirect(
|
||||
reverse(
|
||||
|
@ -1004,7 +1006,9 @@ class FrabXmlView(CampViewMixin, View):
|
|||
qs = (
|
||||
models.EventSlot.objects.filter(event__track__camp=self.camp)
|
||||
.prefetch_related(
|
||||
"event__urls", "event__speakers", "event_session__event_location",
|
||||
"event__urls",
|
||||
"event__speakers",
|
||||
"event_session__event_location",
|
||||
)
|
||||
.order_by("when", "event_session__event_location")
|
||||
)
|
||||
|
|
|
@ -11,6 +11,8 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name="ride", old_name="location", new_name="from_location",
|
||||
model_name="ride",
|
||||
old_name="location",
|
||||
new_name="from_location",
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django.db import models
|
||||
from django.urls import reverse
|
||||
|
||||
from utils.models import CampRelatedModel, UUIDModel
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django import forms
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
@ -11,6 +10,8 @@ from django.views.generic import (
|
|||
ListView,
|
||||
UpdateView,
|
||||
)
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from teams.models import Team
|
||||
from utils.email import add_outgoing_email
|
||||
from utils.mixins import UserIsObjectOwnerMixin
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from tickets.admin import ShopTicketInline
|
||||
|
||||
from .models import (
|
||||
|
|
|
@ -3,6 +3,7 @@ import logging
|
|||
|
||||
import requests
|
||||
from django.conf import settings
|
||||
|
||||
from vendor.coinify.coinify_api import CoinifyAPI
|
||||
|
||||
from .models import CoinifyAPICallback, CoinifyAPIInvoice, CoinifyAPIRequest
|
||||
|
|
|
@ -2,6 +2,7 @@ import factory
|
|||
from django.utils import timezone
|
||||
from factory.django import DjangoModelFactory
|
||||
from psycopg2.extras import DateTimeTZRange
|
||||
|
||||
from utils.factories import UserFactory
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django import forms
|
||||
from django.forms import modelformset_factory
|
||||
|
||||
from shop.models import OrderProductRelation
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import logging
|
|||
from django.conf import settings
|
||||
from django.core.files import File
|
||||
from django.db.models import Q
|
||||
|
||||
from shop.email import add_creditnote_email, add_invoice_email
|
||||
from shop.models import CreditNote, CustomOrder, Invoice, Order
|
||||
from utils.pdf import generate_pdf_letter
|
||||
|
|
|
@ -11,7 +11,9 @@ class Migration(migrations.Migration):
|
|||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="coinifyapicallback", name="headers", field=models.JSONField(),
|
||||
model_name="coinifyapicallback",
|
||||
name="headers",
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="coinifyapicallback",
|
||||
|
@ -24,13 +26,19 @@ class Migration(migrations.Migration):
|
|||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="coinifyapirequest", name="payload", field=models.JSONField(),
|
||||
model_name="coinifyapirequest",
|
||||
name="payload",
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="coinifyapirequest", name="response", field=models.JSONField(),
|
||||
model_name="coinifyapirequest",
|
||||
name="response",
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="epaycallback", name="payload", field=models.JSONField(),
|
||||
model_name="epaycallback",
|
||||
name="payload",
|
||||
field=models.JSONField(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="order",
|
||||
|
|
|
@ -13,6 +13,7 @@ from django.utils import timezone
|
|||
from django.utils.dateparse import parse_datetime
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from unidecode import unidecode
|
||||
|
||||
from utils.models import CreatedUpdatedModel, UUIDModel
|
||||
from utils.slugs import unique_slugify
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ from django.test import TestCase
|
|||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
from psycopg2.extras import DateTimeTZRange
|
||||
|
||||
from shop.forms import OrderProductRelationForm
|
||||
from tickets.factories import TicketTypeFactory
|
||||
from tickets.models import ShopTicket
|
||||
|
|
|
@ -19,6 +19,7 @@ from django.views.decorators.csrf import csrf_exempt
|
|||
from django.views.generic import DetailView, FormView, ListView, View
|
||||
from django.views.generic.base import RedirectView
|
||||
from django.views.generic.detail import SingleObjectMixin
|
||||
|
||||
from shop.models import (
|
||||
CreditNote,
|
||||
EpayCallback,
|
||||
|
|
|
@ -2,6 +2,7 @@ import logging
|
|||
import os
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
from teams.models import Team
|
||||
from utils.email import add_outgoing_email
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
# coding: utf-8
|
||||
import logging
|
||||
|
||||
from camps.models import Camp
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
|
||||
from camps.models import Camp
|
||||
from sponsors.email import add_sponsorticket_email
|
||||
from sponsors.models import Sponsor
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
# coding: utf-8
|
||||
from camps.models import Camp
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
|
||||
from camps.models import Camp
|
||||
from sponsors.models import Sponsor
|
||||
from tickets.models import SponsorTicket, TicketType
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
# Generated by Django 1.11 on 2017-07-11 21:35
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import sponsors.models
|
||||
from django.db import migrations, models
|
||||
|
||||
import sponsors.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.db import models
|
||||
|
||||
from utils.models import CampRelatedModel
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.views.generic import ListView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from .models import Sponsor
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from camps.utils import CampPropertyListFilter
|
||||
from django.contrib import admin
|
||||
|
||||
from camps.utils import CampPropertyListFilter
|
||||
|
||||
from .email import add_added_membership_email, add_removed_membership_email
|
||||
from .models import Team, TeamMember, TeamShift, TeamTask
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ from django.contrib.postgres.fields import DateTimeRangeField
|
|||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.urls import reverse_lazy
|
||||
|
||||
from utils.models import CampRelatedModel, CreatedUpdatedModel, UUIDModel
|
||||
from utils.slugs import unique_slugify
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
|
||||
|
||||
logger = logging.getLogger("bornhack.%s" % __name__)
|
||||
|
||||
|
||||
|
@ -13,6 +12,7 @@ def teammember_saved(sender, instance, created, **kwargs):
|
|||
# call the mail sending function
|
||||
# late import to please django 3.2 or "django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet."
|
||||
from .email import add_new_membership_email
|
||||
|
||||
if not add_new_membership_email(instance):
|
||||
logger.error("Error adding email to outgoing queue")
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from django import template
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from teams.models import TeamMember
|
||||
|
||||
register = template.Library()
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.urls import include, path
|
||||
|
||||
from teams.views.base import (
|
||||
FixIrcAclView,
|
||||
TeamGeneralView,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
@ -9,6 +8,8 @@ from django.urls import reverse_lazy
|
|||
from django.views.generic import DetailView, ListView
|
||||
from django.views.generic.edit import UpdateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from ..models import Team, TeamMember
|
||||
from .mixins import EnsureTeamResponsibleMixin
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
|
||||
from django.views.generic import DetailView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from ..models import Team, TeamMember
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.views.generic import CreateView, DeleteView, ListView, UpdateView
|
||||
from info.models import InfoCategory, InfoItem
|
||||
from reversion.views import RevisionMixin
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from info.models import InfoCategory, InfoItem
|
||||
|
||||
from ..models import Team
|
||||
from .mixins import EnsureTeamResponsibleMixin, TeamViewMixin
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import logging
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.shortcuts import redirect
|
||||
from django.views.generic import DetailView, UpdateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
from profiles.models import Profile
|
||||
|
||||
from ..email import add_added_membership_email, add_removed_membership_email
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from django.contrib import messages
|
||||
from django.shortcuts import redirect
|
||||
from django.views.generic.detail import SingleObjectMixin
|
||||
|
||||
from teams.models import Team, TeamMember
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django import forms
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
|
@ -17,6 +16,8 @@ from django.views.generic import (
|
|||
)
|
||||
from psycopg2.extras import DateTimeTZRange
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from ..models import Team, TeamMember, TeamShift
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from camps.mixins import CampViewMixin
|
||||
from django import forms
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.http import HttpResponseNotAllowed, HttpResponseRedirect
|
||||
from django.views.generic import CreateView, DetailView, UpdateView
|
||||
|
||||
from camps.mixins import CampViewMixin
|
||||
|
||||
from ..models import TaskComment, Team, TeamMember, TeamTask
|
||||
from .mixins import EnsureTeamResponsibleMixin, TeamViewMixin
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.contrib import admin
|
||||
|
||||
from shop.models import OrderProductRelation
|
||||
|
||||
from .models import DiscountTicket, ShopTicket, SponsorTicket, TicketType
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# Generated by Django 2.2.2 on 2019-07-18 18:52
|
||||
from django.conf import settings
|
||||
from django.db import migrations
|
||||
|
||||
from tickets.models import create_ticket_token
|
||||
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue