Przeglądaj źródła

fix missing slug on place table

master
tr4ck3ur des JM2L 7 lat temu
rodzic
commit
9df505da5b
2 zmienionych plików z 3 dodań i 1 usunięć
  1. +2
    -1
      jm2l/upload.py
  2. +1
    -0
      jm2l/views.py

+ 2
- 1
jm2l/upload.py Wyświetl plik

@@ -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 ]


+ 1
- 0
jm2l/views.py Wyświetl plik

@@ -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:


Ładowanie…
Anuluj
Zapisz