diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/orm/management/commands/checksettings.py | 8 | ||||
-rw-r--r-- | lib/orm/management/commands/lsupdates.py | 3 |
2 files changed, 5 insertions, 6 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() diff --git a/lib/orm/management/commands/lsupdates.py b/lib/orm/management/commands/lsupdates.py index 82358620..7bae1720 100644 --- a/lib/orm/management/commands/lsupdates.py +++ b/lib/orm/management/commands/lsupdates.py @@ -136,8 +136,7 @@ class Command(BaseCommand): updated_source=DataSource.objects.get(id=id) updated_source.loaded = True if update_modified: - updated_source.update_time = datetime.today().strftime('%Y-%m-%d %H:%M:%S') - updated_source.lastModifiedDate = updated_source.update_time + updated_source.lastModifiedDate = datetime.today().strftime('%Y-%m-%d %H:%M:%S') updated_source.save() def nist_cwe(self, content): |