[assign ark ws] Fix ARK prefix for organization
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 16 Aug 2017 16:01:19 +0200
changeset 3330 3b78f9dfd44f
parent 3328 e436241e0bf4
child 3331 e5de53db7787
[assign ark ws] Fix ARK prefix for organization it should be ark:/, not ark:// Closes extranet #32206278
cubicweb_saem_ref/views/ws.py
test/test_views.py
--- a/cubicweb_saem_ref/views/ws.py	Thu Jul 20 16:14:09 2017 +0200
+++ b/cubicweb_saem_ref/views/ws.py	Wed Aug 16 16:01:19 2017 +0200
@@ -36,7 +36,7 @@
     # XXX could check Accept=application/json
     def call(self):
         org_ark = self._cw.form['organization']
-        org_ark = org_ark.replace('ark://', '')
+        org_ark = org_ark.replace('ark:/', '')
 
         def error(msg):
             self.wdata([{'error': msg.format(org_ark)}])
--- a/test/test_views.py	Thu Jul 20 16:14:09 2017 +0200
+++ b/test/test_views.py	Wed Aug 16 16:01:19 2017 +0200
@@ -467,7 +467,7 @@
             result = self.app_handle_request(req, 'ark')
             self.assertEqual(json.loads(result),
                              [{'ark': '0/a000000001'}])
-        params = {'organization': 'ark://' + org_ark}
+        params = {'organization': 'ark:/' + org_ark}
         with self.admin_access.web_request(
                 headers={'Accept': 'application/json'},
                 method='POST', **params) as req: