]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
parser: Trivial rename of functions
authorStephen Finucane <stephen@that.guru>
Wed, 30 Nov 2016 15:30:06 +0000 (15:30 +0000)
committerStephen Finucane <stephen@that.guru>
Thu, 1 Dec 2016 18:45:32 +0000 (18:45 +0000)
'auto_delegate' doesn't actually delegate the patches - it merely finds
a suitable delegate based on the filename. Rename the function
accordingly.

'find_delegate' is also renamed to prevent confusion.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Tested-by: Tom Rini <trini@konsulko.com>
patchwork/parser.py

index 2df92787320c175bffde7ecd8b082e00df4d04c3..9d1b79ef4b760d2dbdeb36b0e2dfe436b2c2f52d 100644 (file)
@@ -688,7 +688,7 @@ def find_state(mail):
     return get_default_initial_patch_state()
 
 
-def auto_delegate(project, filenames):
+def find_delegate_by_filename(project, filenames):
     if not filenames:
         return None
 
@@ -714,7 +714,7 @@ def auto_delegate(project, filenames):
     return patch_delegate
 
 
-def find_delegate(mail):
+def find_delegate_by_header(mail):
     """Return the delegate with the given email or None."""
     delegate_email = mail.get('X-Patchwork-Delegate', '').strip()
     if delegate_email:
@@ -784,10 +784,10 @@ def parse_mail(mail, list_id=None):
         # we delay the saving until we know we have a patch.
         author.save()
 
-        delegate = find_delegate(mail)
+        delegate = find_delegate_by_header(mail)
         if not delegate and diff:
             filenames = find_filenames(diff)
-            delegate = auto_delegate(project, filenames)
+            delegate = find_delegate_by_filename(project, filenames)
 
         series = find_series(mail)
         # We will create a new series if: