]> git.parisson.com Git - telemeta.git/commitdiff
fix various bugs giving 404 instead of 500
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 21 May 2015 07:24:15 +0000 (09:24 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 21 May 2015 07:24:15 +0000 (09:24 +0200)
doc/content/Using-Git.rst
telemeta/management/commands/telemeta-import-corpus-from-dir.py
telemeta/templatetags/telemeta_utils.py
telemeta/views/item.py

index 43d8b0af1fed1a1f32fdde2525c49757765e30ee..bc840363a4bc8d970177e1ebd84ed14f2be0167d 100644 (file)
@@ -3,6 +3,7 @@ Telemeta project now uses Git for development
 
 :category: Development
 :date: 2011-10-26 06:53
+:tags: git
 
 Ten months ago, I started to look at other version control systems because I was fed up with the Subversion centralized model. It tested Git, Mercurial, Bazaar, etc.. Bazaar was the good choice because it allowed the dev teams to make branches easily in a decentralized environment, to push commits to the old subversion repository, to keep an easy syntax, etc...
 
index c5c637976d16626baa3e6c4c0c305681629701f9..925a621741f28ec3183dd8c9de5700a664c0bc8a 100644 (file)
@@ -134,7 +134,7 @@ class Command(BaseCommand):
                         corpus_id = slugify(unicode(corpus_name))
                         collection_id = corpus_id + '_' + slugify(unicode(collection_name))
                         item_id = collection_id + '_' + slugify(unicode(item_name))
-                        
+
                         cc = MediaCorpus.objects.filter(code=corpus_id)
                         if cc:
                             corpus = cc[0]
index 7cf3488f40edfdbec46634d7946f18d2f89c5ebd..a069afbbfce40d42689b728961f534ef87aca500 100644 (file)
@@ -366,7 +366,7 @@ def to_string(list):
 def get_filename(object):
     if isinstance(object, unicode):
        return object.split('/')[-1]
-    elif object.path:
+    elif hasattr(object, 'path'):
         return object.path.split(os.sep)[-1]
     else:
         return ''
index 4203a45bb1848562fdad25da7e93657a276d7af3..2d40e40edbda6808f63780820b8224b8719da630 100644 (file)
@@ -132,11 +132,11 @@ class ItemView(ItemBaseMixin):
 
         # get item with one of its given marker_id
         if not public_id and marker_id:
-            marker = MediaItemMarker.objects.get(public_id=marker_id)
+            marker = get_object_or_404(MediaItemMarker, public_id=marker_id)
             item_id = marker.item_id
             item = MediaItem.objects.get(id=item_id)
         else:
-            item = MediaItem.objects.get(public_id=public_id)
+            item = get_object_or_404(MediaItem, public_id=public_id)
 
         access = get_item_access(item, request.user)