forked from expo/troggle
FIX2
This commit is contained in:
parent
5ade60e0cf
commit
254f028575
@ -173,6 +173,7 @@ def newLogbookEntry(request, expeditionyear, pdate = None, pslug = None):
|
|||||||
if request.method == 'POST': # If the form has been submitted...
|
if request.method == 'POST': # If the form has been submitted...
|
||||||
tripForm = TripForm(request.POST) # A form bound to the POST data
|
tripForm = TripForm(request.POST) # A form bound to the POST data
|
||||||
personTripFormSet = PersonTripFormSet(request.POST)
|
personTripFormSet = PersonTripFormSet(request.POST)
|
||||||
|
if tripForm.is_valid() and personTripFormSet.is_valid(): # All validation rules pass
|
||||||
dateStr = tripForm.cleaned_data["date"].strftime("%Y-%m-%d")
|
dateStr = tripForm.cleaned_data["date"].strftime("%Y-%m-%d")
|
||||||
directory = os.path.join(settings.EXPOWEB,
|
directory = os.path.join(settings.EXPOWEB,
|
||||||
"years",
|
"years",
|
||||||
@ -180,7 +181,6 @@ def newLogbookEntry(request, expeditionyear, pdate = None, pslug = None):
|
|||||||
"autologbook")
|
"autologbook")
|
||||||
filename = os.path.join(directory,
|
filename = os.path.join(directory,
|
||||||
dateStr + "." + slugify(tripForm.cleaned_data["title"])[:50] + ".html")
|
dateStr + "." + slugify(tripForm.cleaned_data["title"])[:50] + ".html")
|
||||||
if tripForm.is_valid() and personTripFormSet.is_valid(): # All validation rules pass
|
|
||||||
if not os.path.isdir(directory):
|
if not os.path.isdir(directory):
|
||||||
os.mkdir(directory)
|
os.mkdir(directory)
|
||||||
if pslug and pdate:
|
if pslug and pdate:
|
||||||
|
Loading…
Reference in New Issue
Block a user