fix migration from pre-3.13.1 versions (closes #2846978) stable
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 31 May 2013 11:13:06 +0200
branchstable
changeset 9131 b3ad80aa645f
parent 9130 0f1504a9fb51
child 9132 b6bcf99504c9
fix migration from pre-3.13.1 versions (closes #2846978) Need to check the existence of the asource column before the first call to eid_type_source.
server/sources/native.py
--- a/server/sources/native.py	Wed Jul 03 14:33:27 2013 +0200
+++ b/server/sources/native.py	Fri May 31 11:13:06 2013 +0200
@@ -410,14 +410,14 @@
 
 
     def init(self, activated, source_entity):
-        super(NativeSQLSource, self).init(activated, source_entity)
-        self.init_creating(source_entity._cw.cnxset)
         try:
             # test if 'asource' column exists
             query = self.dbhelper.sql_add_limit_offset('SELECT asource FROM entities', 1)
             source_entity._cw.system_sql(query)
         except Exception as ex:
             self.eid_type_source = self.eid_type_source_pre_131
+        super(NativeSQLSource, self).init(activated, source_entity)
+        self.init_creating(source_entity._cw.cnxset)
 
     def shutdown(self):
         if self._eid_creation_cnx: