[dataimport, migration] more fixes in the spirit of a6c32edabc8d:

[entity, metadata] huuum, use resolvable url as cwuri... And fix existing ones.

Closes #3390388

authorDimitri Papadopoulos <dimitri.papadopoulos@cea.fr>
changesetb0dd5b57d2d8
branchdefault
phasepublic
hiddenno
parent revision#29987849a435 [doc] Fix typo in devrepo/fti
child revision#6e2244784b7d Fix typo in a setup.py comment
files modified by this revision
dataimport.py
misc/migration/bootstrapmigration_repository.py
# HG changeset patch
# User Dimitri Papadopoulos <dimitri.papadopoulos@cea.fr>
# Date 1392300570 -3600
# Thu Feb 13 15:09:30 2014 +0100
# Node ID b0dd5b57d2d84725eaf25820f45eca0146bc91cc
# Parent 29987849a43599a01dc7fb3c4d72d6c5def3300e
[dataimport, migration] more fixes in the spirit of a6c32edabc8d:

[entity, metadata] huuum, use resolvable url as cwuri... And fix existing ones.

Closes #3390388

diff --git a/dataimport.py b/dataimport.py
@@ -871,11 +871,11 @@
1 
2      def generate(self, entity, rtype):
3          return getattr(self, 'gen_%s' % rtype)(entity)
4 
5      def gen_cwuri(self, entity):
6 -        return u'%seid/%s' % (self.baseurl, entity.eid)
7 +        return u'%s%s' % (self.baseurl, entity.eid)
8 
9      def gen_creation_date(self, entity):
10          return self.time
11      def gen_modification_date(self, entity):
12          return self.time
diff --git a/misc/migration/bootstrapmigration_repository.py b/misc/migration/bootstrapmigration_repository.py
@@ -155,11 +155,11 @@
13          base_url = session.base_url()
14          for eid, in rql('Any X', ask_confirm=False):
15              type, source, extid = session.describe(eid)
16              if source == 'system':
17                  rql('SET X cwuri %(u)s WHERE X eid %(x)s',
18 -                    {'x': eid, 'u': base_url + u'eid/%s' % eid})
19 +                    {'x': eid, 'u': u'%s%s' % (base_url, eid)})
20          isession.commit()
21          session.set_shared_data('do-not-insert-cwuri', False)
22 
23  if applcubicwebversion < (3, 5, 0) and cubicwebversion >= (3, 5, 0):
24      # check that migration is not doomed