server/schemaserial.py
changeset 3737 e8c669e33689
parent 3732 f9336257e0b9
child 3890 d7a270f50f54
--- a/server/schemaserial.py	Mon Oct 19 18:15:45 2009 +0200
+++ b/server/schemaserial.py	Mon Oct 19 20:01:14 2009 +0200
@@ -277,7 +277,7 @@
     """synchronize schema and permissions in the database according to
     current schema
     """
-    quiet = not os.environ['APYCOT_ROOT']
+    quiet = os.environ.get('APYCOT_ROOT')
     if not quiet:
         _title = '-> storing the schema in the database '
         print _title,
@@ -299,7 +299,8 @@
     for ertype in aller:
         # skip eid and has_text relations
         if ertype in VIRTUAL_RTYPES:
-            pb.update()
+            if pb is not None:
+                pb.update()
             continue
         for rql, kwargs in erschema2rql(schema[ertype]):
             if verbose: