From: Stephen Finucane Date: Wed, 30 Nov 2016 15:30:06 +0000 (+0000) Subject: parser: Trivial rename of functions X-Git-Tag: v2.0.0-rc1~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7557edac092942bfb9a7d15a2e7c278703050a3e;p=thirdparty%2Fpatchwork.git parser: Trivial rename of functions '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 Tested-by: Tom Rini --- diff --git a/patchwork/parser.py b/patchwork/parser.py index 2df92787..9d1b79ef 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -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: