[ckan-changes] commit/ckan: kindly: add error to task status

Bitbucket commits-noreply at bitbucket.org
Wed Nov 2 00:53:38 UTC 2011


1 new commit in ckan:


https://bitbucket.org/okfn/ckan/changeset/be2c10b12d72/
changeset:   be2c10b12d72
branch:      feature-1371-task-status-logic-layer
user:        kindly
date:        2011-11-02 01:53:23
summary:     add error to task status
affected #:  4 files

diff -r ae5cd77638ac5e3cd6d6ccc0fe3db3cb74604cf6 -r be2c10b12d72d34e002c91eb36ad39779ccfc53c ckan/logic/schema.py
--- a/ckan/logic/schema.py
+++ b/ckan/logic/schema.py
@@ -257,6 +257,7 @@
         'key': [not_empty, unicode],
         'value': [not_missing],
         'state': [ignore_missing],
-        'last_updated': [ignore_missing]
+        'last_updated': [ignore_missing],
+        'error': [ignore_missing]
     }
     return schema


diff -r ae5cd77638ac5e3cd6d6ccc0fe3db3cb74604cf6 -r be2c10b12d72d34e002c91eb36ad39779ccfc53c ckan/migration/versions/043_add_task_status.py
--- a/ckan/migration/versions/043_add_task_status.py
+++ b/ckan/migration/versions/043_add_task_status.py
@@ -11,6 +11,7 @@
             "key" text NOT NULL,
             "value" text NOT NULL,
             "state" text,
+            "error" text,
             last_updated timestamp without time zone
         );
 


diff -r ae5cd77638ac5e3cd6d6ccc0fe3db3cb74604cf6 -r be2c10b12d72d34e002c91eb36ad39779ccfc53c ckan/model/task_status.py
--- a/ckan/model/task_status.py
+++ b/ckan/model/task_status.py
@@ -14,6 +14,7 @@
     Column('key', UnicodeText, nullable=False),
     Column('value', UnicodeText, nullable=False),
     Column('state', UnicodeText),
+    Column('error', UnicodeText),
     Column('last_updated', DateTime, default=datetime.now),
     sa.UniqueConstraint('entity_id', 'task_type', 'key')
 )


diff -r ae5cd77638ac5e3cd6d6ccc0fe3db3cb74604cf6 -r be2c10b12d72d34e002c91eb36ad39779ccfc53c ckan/tests/functional/api/test_action.py
--- a/ckan/tests/functional/api/test_action.py
+++ b/ckan/tests/functional/api/test_action.py
@@ -561,7 +561,8 @@
             'task_type': u'test_task',
             'key': u'test_key',
             'value': u'test_value',
-            'state': u'test_state'
+            'state': u'test_state',
+            'error': u'test_error',
         }
         postparams = '%s=1' % json.dumps(task_status)
         res = self.app.post(
@@ -569,6 +570,7 @@
             extra_environ={'Authorization': str(self.sysadmin_user.apikey)},
         )
         task_status_updated = json.loads(res.body)['result']
+        
         task_status_id = task_status_updated.pop('id')
         task_status_updated.pop('last_updated')
         assert task_status_updated == task_status, (task_status_updated, task_status)
@@ -594,7 +596,8 @@
                     'task_type': u'test_task',
                     'key': u'test_task_1',
                     'value': u'test_value_1',
-                    'state': u'test_state'
+                    'state': u'test_state',
+                    'error': u'test_error'
                 },
                 {
                     'entity_id': package_created['id'],
@@ -602,7 +605,8 @@
                     'task_type': u'test_task',
                     'key': u'test_task_2',
                     'value': u'test_value_2',
-                    'state': u'test_state'
+                    'state': u'test_state',
+                    'error': u'test_error'
                 }
             ]
         }
@@ -653,7 +657,8 @@
             'task_type': u'test_task',
             'key': u'test_task_status_show',
             'value': u'test_value',
-            'state': u'test_state'
+            'state': u'test_state',
+            'error': u'test_error'
         }
         postparams = '%s=1' % json.dumps(task_status)
         res = self.app.post(
@@ -682,7 +687,8 @@
             'task_type': u'test_task',
             'key': u'test_task_status_delete',
             'value': u'test_value',
-            'state': u'test_state'
+            'state': u'test_state',
+            'error': u'test_error'
         }
         postparams = '%s=1' % json.dumps(task_status)
         res = self.app.post(

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list