Skip to content
Snippets Groups Projects
Commit 282be17b authored by Manon Blanco's avatar Manon Blanco
Browse files

Use hash_object function

parent bc7118b0
No related branches found
No related tags found
No related merge requests found
# Generated by Django 3.2.5 on 2021-11-04 08:14
import json
from hashlib import md5
from django.db import migrations
def build_hash_configuration(configuration):
configuration_json = json.dumps(configuration, sort_keys=True).encode('utf-8')
return md5(configuration_json).hexdigest()
from arkindex.dataimport.utils import hash_object
def use_worker_configuration(apps, schema_editor):
......@@ -22,7 +16,7 @@ def use_worker_configuration(apps, schema_editor):
configuration=worker_run.old_configuration,
defaults={
'name': f'config n°{index} - {worker.name}',
'configuration_hash': build_hash_configuration(worker_run.old_configuration)
'configuration_hash': hash_object(worker_run.old_configuration)
}
)
worker_run.configuration = worker_configuration
......
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