# HG changeset patch # User cavaliet # Date 1370964883 -7200 # Node ID e9fa445e2c4db69b0595306680e7fee7ae5db896 # Parent d769f46233748441f7cfd4afd5b85d6163ef9091 better place for cinelab json validation diff -r d769f4623374 -r e9fa445e2c4d src/ldt/ldt/api/ldt/serializers/cinelabserializer.py --- 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"]