diff options
Diffstat (limited to 'lib/orm/management/commands/checksettings.py')
-rw-r--r-- | lib/orm/management/commands/checksettings.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/orm/management/commands/checksettings.py b/lib/orm/management/commands/checksettings.py index 7dbcf66f..c4b646d0 100644 --- a/lib/orm/management/commands/checksettings.py +++ b/lib/orm/management/commands/checksettings.py @@ -36,7 +36,7 @@ class Command(BaseCommand): super(Command, self).__init__(*args, **kwargs) self.guesspath = DN(DN(DN(DN(DN(DN(DN(__file__))))))) - # NOTE: explicitly skip "_comment_" elements or items + # NOTE: explicitly skip "_comment*" elements or items # to allow embedding comments in the JSON files def _load_datasource(self,dir): for ds in glob.glob(os.path.join(dir,'datasource*.json')): @@ -55,7 +55,7 @@ class Command(BaseCommand): #print(" LOAD_DATASOURCE:%s:%s" % (datasource['key'],datasource['description'])) ds,create = DataSource.objects.get_or_create(key=datasource['key']) for key in datasource.keys(): - if "_comment_" == key: + if key.startswith("_comment"): continue; setattr(ds, key, datasource[key]) ds.save() @@ -76,7 +76,7 @@ class Command(BaseCommand): #print(" LOAD_GROUPS:%s" % (group['name'])) ds,create = Group.objects.get_or_create(name=group['name']) for key in group.keys(): - if "_comment_" == key: + if key.startswith("_comment"): continue; setattr(ds, key, group[key]) ds.save() @@ -92,7 +92,7 @@ class Command(BaseCommand): #print(" LOAD_SRTUSER:%s" % (srtuser['name'])) ds,create = SrtUser.objects.get_or_create(username=srtuser['name']) for key in srtuser.keys(): - if "_comment_" == key: + if key.startswith("_comment"): continue; setattr(ds, key, srtuser[key]) ds.save() |