Merge issues
authorverrierj
Fri, 13 Jan 2012 17:28:40 +0100
changeset 386 4539db96ec75
parent 385 64a187532417
child 387 398c70610f99
child 392 65c1898141da
Merge issues
src/ldt/ldt/ldt_utils/templates/front/front_search_results.html
src/ldt/ldt/ldt_utils/views/front.py
src/ldt/ldt/ldt_utils/views/json.py
--- a/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html	Fri Jan 13 17:05:50 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/templates/front/front_search_results.html	Fri Jan 13 17:28:40 2012 +0100
@@ -145,7 +145,7 @@
                             <a href="{% url ldt.ldt_utils.views.lignesdetemps.index_segment segment.project_id segment.iri_id segment.ensemble_id segment.decoupage_id segment.element_id %}"><img src="{{LDT_MEDIA_PREFIX}}img/annot_icon_80x45.png" width="80" height="45" /></a>
                             <!--p class="duree_segment">{{ segment.duration|str_duration:"::" }}</p-->
                         </div>
-                        <h4 class="title_segment"><a class="blue under" href="{% url ldt.ldt_utils.views.lignesdetemps.index_segment segment.project_id segment.iri_id segment.ensemble_id segment.decoupage_id segment.element_id %}">
+                        <h4 class="title_segment"><a class="blue under" href="{% url ldt.ldt_utils.views.front.annot_content segment.iri_id segment.decoupage_id %}">
                           {% if segment.title %}{{ segment.title }}{% else %}{% trans "No title" %}{% endif %}</a></h4>
                         <p class="text_segment">{% if segment.context %}{{ segment.context }}{% endif %}<br/>{% trans "Begin" %} : {{ segment.begin|str_duration:"::" }} - {% trans "duration" %} : {{ segment.duration|str_duration:"::" }}</h4>
                     </li>
--- a/src/ldt/ldt/ldt_utils/views/front.py	Fri Jan 13 17:05:50 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/views/front.py	Fri Jan 13 17:28:40 2012 +0100
@@ -73,7 +73,7 @@
     # Vars for player
     player_id = "player_project_" + proj.ldt_id
     
-    json_url = reverse("ldt.ldt_utils.views.json.project_json_id", args=[proj.ldt_id])
+    json_url = reverse("ldt.ldt_utils.views.json.project_json_cutting_id", args=[proj.ldt_id, cutting_id])
     player_width = 550
     player_height = 380
     stream_mode = proj.stream_mode
--- a/src/ldt/ldt/ldt_utils/views/json.py	Fri Jan 13 17:05:50 2012 +0100
+++ b/src/ldt/ldt/ldt_utils/views/json.py	Fri Jan 13 17:28:40 2012 +0100
@@ -9,21 +9,25 @@
 import ldt.auth as ldt_auth
 from guardian.shortcuts import get_objects_for_user
 
+
+# TODO : for tests only, we use Project.objects
+# should be set to Project.safe_objects for production 
+
 def project_json_id(request, id): 
     
-    project = get_object_or_404(Project.safe_objects, ldt_id=id)
+    project = get_object_or_404(Project.objects, ldt_id=id)
 
     return project_json(request, project, False)
 
 def project_json_cutting_id(request, id, cutting_id):
 
-    project = get_object_or_404(Project.safe_objects, ldt_id=id)
+    project = get_object_or_404(Project.objects, ldt_id=id)
 
     return project_json(request, project, first_cutting=cutting_id)
 
 def project_json_externalid(request, id): 
         
-    res_proj = get_list_or_404(Project.safe_objects.order_by('-modification_date'), contents__external_id=id) #@UndefinedVariable
+    res_proj = get_list_or_404(Project.objects.order_by('-modification_date'), contents__external_id=id) #@UndefinedVariable
     
     return project_json(request, res_proj[0], False)
 
@@ -31,8 +35,10 @@
 
 def project_json(request, project, serialize_contents=True, first_cutting=None):
     
-    if not ldt_auth.check_access(request.user, project):
-        return HttpResponseForbidden(_("You can not access this project"))
+# TODO : the following lines have been uncommented for tests only
+# they should not be commented for production
+#    if not ldt_auth.check_access(request.user, project):
+#        return HttpResponseForbidden(_("You can not access this project"))
         
     mimetype = request.REQUEST.get("mimetype")
     if mimetype is None: