[PATCH 5/6] trivial: Fix some nits

Stephen Finucane stephen at that.guru
Wed Jan 10 11:05:25 AEDT 2018


Signed-off-by: Stephen Finucane <stephen at that.guru>
---
 patchwork/signals.py | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/patchwork/signals.py b/patchwork/signals.py
index e31ac2f3..e5e7370f 100644
--- a/patchwork/signals.py
+++ b/patchwork/signals.py
@@ -74,9 +74,9 @@ def create_cover_created_event(sender, instance, created, raw, **kwargs):
 
     def create_event(cover):
         return Event.objects.create(
+            category=Event.CATEGORY_COVER_CREATED,
             project=cover.project,
-            cover=cover,
-            category=Event.CATEGORY_COVER_CREATED)
+            cover=cover)
 
     # don't trigger for items loaded from fixtures or new items
     if raw or not created:
@@ -90,9 +90,9 @@ def create_patch_created_event(sender, instance, created, raw, **kwargs):
 
     def create_event(patch):
         return Event.objects.create(
+            category=Event.CATEGORY_PATCH_CREATED,
             project=patch.project,
-            patch=patch,
-            category=Event.CATEGORY_PATCH_CREATED)
+            patch=patch)
 
     # don't trigger for items loaded from fixtures or new items
     if raw or not created:
@@ -106,9 +106,9 @@ def create_patch_state_changed_event(sender, instance, raw, **kwargs):
 
     def create_event(patch, before, after):
         return Event.objects.create(
+            category=Event.CATEGORY_PATCH_STATE_CHANGED,
             project=patch.project,
             patch=patch,
-            category=Event.CATEGORY_PATCH_STATE_CHANGED,
             previous_state=before,
             current_state=after)
 
@@ -129,9 +129,9 @@ def create_patch_delegated_event(sender, instance, raw, **kwargs):
 
     def create_event(patch, before, after):
         return Event.objects.create(
+            category=Event.CATEGORY_PATCH_DELEGATED,
             project=patch.project,
             patch=patch,
-            category=Event.CATEGORY_PATCH_DELEGATED,
             previous_delegate=before,
             current_delegate=after)
 
@@ -153,10 +153,10 @@ def create_patch_completed_event(sender, instance, created, raw, **kwargs):
 
     def create_event(patch, series):
         return Event.objects.create(
+            category=Event.CATEGORY_PATCH_COMPLETED,
             project=patch.project,
             patch=patch,
-            series=series,
-            category=Event.CATEGORY_PATCH_COMPLETED)
+            series=series)
 
     # don't trigger for items loaded from fixtures or existing items
     if raw or not created:
@@ -190,10 +190,10 @@ def create_check_created_event(sender, instance, created, raw, **kwargs):
         # TODO(stephenfin): It might make sense to add a 'project' field to
         # 'check' to prevent lookups here and in the REST API
         return Event.objects.create(
+            category=Event.CATEGORY_CHECK_CREATED,
             project=check.patch.project,
             patch=check.patch,
-            created_check=check,
-            category=Event.CATEGORY_CHECK_CREATED)
+            created_check=check)
 
     # don't trigger for items loaded from fixtures or existing items
     if raw or not created:
@@ -207,9 +207,9 @@ def create_series_created_event(sender, instance, created, raw, **kwargs):
 
     def create_event(series):
         return Event.objects.create(
+            category=Event.CATEGORY_SERIES_CREATED,
             project=series.project,
-            series=series,
-            category=Event.CATEGORY_SERIES_CREATED)
+            series=series)
 
     # don't trigger for items loaded from fixtures or existing items
     if raw or not created:
@@ -235,9 +235,9 @@ def create_series_completed_event(sender, instance, created, raw, **kwargs):
 
     def create_event(series):
         return Event.objects.create(
+            category=Event.CATEGORY_SERIES_COMPLETED,
             project=series.project,
-            series=series,
-            category=Event.CATEGORY_SERIES_COMPLETED)
+            series=series)
 
     # don't trigger for items loaded from fixtures or existing items
     if raw or not created:
-- 
2.14.3



More information about the Patchwork mailing list