diff --git a/.gitignore b/.gitignore index f84b6ab..3a63df7 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ stacktask.egg-info/* dist/* .tox/* +env/* diff --git a/stacktask/api/migrations/0002_auto_20160815_2249.py b/stacktask/api/migrations/0002_auto_20160815_2249.py new file mode 100644 index 0000000..3cd1ba2 --- /dev/null +++ b/stacktask/api/migrations/0002_auto_20160815_2249.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='task', + name='hash_key', + field=models.CharField(max_length=64, db_index=True), + ), + ] diff --git a/stacktask/api/models.py b/stacktask/api/models.py index 4427700..a3e053c 100644 --- a/stacktask/api/models.py +++ b/stacktask/api/models.py @@ -30,7 +30,7 @@ class Task(models.Model): """ uuid = models.CharField(max_length=32, default=hex_uuid, primary_key=True) - hash_key = models.CharField(max_length=32, db_index=True) + hash_key = models.CharField(max_length=64, db_index=True) # who is this: ip_address = models.GenericIPAddressField() diff --git a/stacktask/api/v1/utils.py b/stacktask/api/v1/utils.py index 843df5d..8acbf1b 100644 --- a/stacktask/api/v1/utils.py +++ b/stacktask/api/v1/utils.py @@ -148,8 +148,11 @@ def create_task_hash(task_type, action_list): for action in action_list: hashable_list.append(action['name']) + if not action['serializer']: + continue # iterate like this to maintain consistent order for hash - for field in action['action'].required: + fields = sorted(action['serializer'].validated_data.keys()) + for field in fields: try: hashable_list.append( action['serializer'].validated_data[field])