always ignore postgresql settings if support is disabled
This commit is contained in:
parent
1ed314d150
commit
03d0efa0e3
|
@ -140,7 +140,7 @@ class FormDef(StorableObject):
|
|||
def data_class(self):
|
||||
if hasattr(sys.modules['formdef'], self.url_name.title()):
|
||||
return getattr(sys.modules['formdef'], self.url_name.title())
|
||||
if get_cfg('postgresql', {}):
|
||||
if get_publisher().has_site_option('postgresql') and get_cfg('postgresql', {}):
|
||||
table_name = 'formdata_' + self.url_name.replace('-', '_')
|
||||
cls = new.classobj(self.url_name.title(), (sql.SqlFormData,),
|
||||
{'_formdef': self,
|
||||
|
@ -156,7 +156,7 @@ class FormDef(StorableObject):
|
|||
new_url_name = simplify(self.name)
|
||||
if not self.url_name:
|
||||
self.url_name = new_url_name
|
||||
if get_cfg('postgresql', {}):
|
||||
if get_publisher().has_site_option('postgresql') and get_cfg('postgresql', {}):
|
||||
sql.do_formdef_tables(self)
|
||||
elif new_url_name != self.url_name:
|
||||
# title changed, url will be changed only if there are not yet any
|
||||
|
|
|
@ -128,7 +128,7 @@ class WcsPublisher(StubWcsPublisher):
|
|||
import wcs.workflows
|
||||
wcs.workflows.load_extra()
|
||||
|
||||
if get_cfg('postgresql', {}):
|
||||
if self.has_site_option('postgresql') and get_cfg('postgresql', {}):
|
||||
import sql
|
||||
self.user_class = sql.SqlUser
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue