move createcamp script to camps app

This commit is contained in:
Stephan Telling 2017-06-04 13:08:59 +02:00
parent 6cf4e9577b
commit 733028e4b7
No known key found for this signature in database
GPG key ID: D4892289F36ADA9B
4 changed files with 5 additions and 5 deletions

View file

View file

@ -28,9 +28,9 @@ class Command(BaseCommand):
# files to create, relative to DJANGO_BASE_PATH
files = [
'sponsors/templates/{camp_slug}-sponsors.html',
'camps/templates/{camp_slug}-camp_detail.html',
'program/templates/{camp_slug}-call_for_speakers.html'
'sponsors/templates/{camp_slug}_sponsors.html',
'camps/templates/{camp_slug}_camp_detail.html',
'program/templates/{camp_slug}_call_for_speakers.html'
]
# directories to create, relative to DJANGO_BASE_PATH

View file

@ -1,6 +1,6 @@
from django.views.generic import ListView, DetailView
from django.utils import timezone
from .models import *
from .models import Camp
from django.shortcuts import redirect
from .mixins import CampViewMixin
from django.views import View
@ -10,7 +10,7 @@ logger = logging.getLogger("bornhack.%s" % __name__)
class CampRedirectView(CampViewMixin, View):
logger = logging.getLogger("bornhack.%s" % __name__)
def dispatch(self, request, *args, **kwargs):
# find the closest camp in the past
prevcamp = Camp.objects.filter(camp__endswith__lt=timezone.now()).order_by('-camp')[0]