forked from tr4ck3ur/jm2l
Merge branch 'tr4ck3ur/various_fixes_2017' of JM2L/jm2l into master
This commit is contained in:
+2
-1
@@ -14,6 +14,7 @@ import cStringIO as StringIO
|
||||
from .models import User, Place, Tiers, Event, SallePhy
|
||||
from .blenderthumbnailer import blend_extract_thumb, write_png
|
||||
from jm2l.const import CurrentYear
|
||||
from slugify import slugify
|
||||
|
||||
MIN_FILE_SIZE = 1 # bytes
|
||||
MAX_FILE_SIZE = 500000000 # bytes
|
||||
@@ -128,7 +129,7 @@ class MediaPath():
|
||||
if media_table=='tiers':
|
||||
slug = Tiers.by_id(linked_id).slug
|
||||
if media_table=='place':
|
||||
slug = Place.by_id(linked_id).slug
|
||||
slug = Place.by_id(linked_id).slug or slugify(Place.by_id(linked_id).name)
|
||||
if media_table=='salle':
|
||||
slug = SallePhy.by_id(linked_id).slug
|
||||
p = IMAGEPATH + [ media_table, slug ]
|
||||
|
||||
@@ -1179,6 +1179,7 @@ def Modal(request):
|
||||
if request.method == 'POST' and form.validate():
|
||||
form.populate_obj(place)
|
||||
place.created_by=request.user.uid
|
||||
place.slug = slugify(place.name)
|
||||
if uid>0:
|
||||
DBSession.merge(place)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user