Commits

Yohan Boniface committed 3d1853c

UploadData: error type message if no feature has been created (cf #74)

  • Participants
  • Parent commits 9f7f8ea

Comments (0)

Files changed (1)

leaflet_storage/views.py

                 transaction.savepoint_commit(sid)
             counter += 1
         transaction.commit()
-        kwargs = {
-            'datalayer': datalayer.json,
-            'info': "%d features created!" % counter,
-        }
+        if counter:
+            kwargs = {
+                'datalayer': datalayer.json,
+                'info': _("%d features created!") % counter,
+            }
+        else:
+            kwargs = {
+                'error': _("No valid feature has been found :("),
+            }
         return simple_json_response(**kwargs)
 
     def render_to_response(self, context, **response_kwargs):