--- a/src/ldt/ldt/api/ldt/serializers/cinelabserializer.py Fri May 31 15:48:41 2013 +0200
+++ b/src/ldt/ldt/api/ldt/serializers/cinelabserializer.py Tue Jun 11 17:34:43 2013 +0200
@@ -60,6 +60,9 @@
"""
cinelab = simplejson.loads(content)
+ # We validate the json
+ self.validate_cinelab_json(cinelab)
+ # We search if the id is set
meta = cinelab["meta"]
if "id" in meta and meta["id"]!="":
ldt_id = meta["id"]
@@ -84,8 +87,7 @@
def cinelab_to_ldt(self, cinelab, ldt_id=None):
- # We validate the json
- self.validate_cinelab_json(cinelab)
+ # We suppose that the cinelab json has been validated
# Start xml
meta = cinelab["meta"]
annotation_types = cinelab["annotation-types"]