Skip to content
Snippets Groups Projects
Commit b89d1cae authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

TMSS-162: process review comments

parent b3f4b9a9
No related branches found
No related tags found
2 merge requests!119Cob 90 buffers for quantized TAB output,!109Resolve TMSS-162
...@@ -38,15 +38,15 @@ def execute_and_log(cmd): ...@@ -38,15 +38,15 @@ def execute_and_log(cmd):
if err is not None: if err is not None:
logger.info("STDERR: %s" % err.decode('utf-8').strip()) logger.info("STDERR: %s" % err.decode('utf-8').strip())
def delete_old_migrations():
def delete_old_migrations():
logger.info('Removing old migrations...') logger.info('Removing old migrations...')
files = glob_migrations() files = glob_migrations()
for f in [path for path in files if ("auto" in path or "populate" in path)]: for f in [path for path in files if ("auto" in path or "populate" in path)]:
logger.info('Deleting: %s' % f) logger.info('Deleting: %s' % f)
os.remove(f) os.remove(f)
#execute_and_log('git rm %s' % f)
def make_django_migrations(): def make_django_migrations():
...@@ -92,7 +92,6 @@ def remake_migrations(): ...@@ -92,7 +92,6 @@ def remake_migrations():
delete_old_migrations() delete_old_migrations()
make_django_migrations() make_django_migrations()
make_populate_migration() make_populate_migration()
#put_migrations_under_version_control()
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -180,13 +180,18 @@ class Subtask(BasicCommon): ...@@ -180,13 +180,18 @@ class Subtask(BasicCommon):
'''override of normal save method, doing a validation of the specification against the schema first '''override of normal save method, doing a validation of the specification against the schema first
:raises SpecificationException in case the specification does not validate against the schema''' :raises SpecificationException in case the specification does not validate against the schema'''
self.validate_specification_against_schema() self.validate_specification_against_schema()
creating = self._state.adding creating = self._state.adding # True on create, False on update
super().save(force_insert, force_update, using, update_fields) super().save(force_insert, force_update, using, update_fields)
# log if either state update or new entry: # log if either state update or new entry:
if self.state != self.__original_state or creating is True: if self.state != self.__original_state or creating is True:
state_update = SubtaskStateLog(subtask=self, old_state=self.__original_state, new_state=self.state, if self.created_or_updated_by_user is None:
user=self.created_or_updated_by_user, user_identifier=self.created_or_updated_by_user.email) identifier = None
state_update.save() else:
identifier = self.created_or_updated_by_user.email
log_entry = SubtaskStateLog(subtask=self, old_state=self.__original_state, new_state=self.state,
user=self.created_or_updated_by_user, user_identifier=identifier)
log_entry.save()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment