Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/tracker/component_helpers.py b/tracker/component_helpers.py
index 786ab96..a98da55 100644
--- a/tracker/component_helpers.py
+++ b/tracker/component_helpers.py
@@ -1,7 +1,6 @@
-# Copyright 2016 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file or at
-# https://developers.google.com/open-source/licenses/bsd
+# Copyright 2016 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
"""Helper functions for component-related servlets."""
from __future__ import print_function
@@ -12,7 +11,7 @@
import logging
import re
-from proto import tracker_pb2
+from mrproto import tracker_pb2
from tracker import tracker_bizobj
@@ -33,11 +32,15 @@
deprecated = 'deprecated' in post_data
admin_usernames = [
- uname.strip() for uname in re.split('[,;\s]+', post_data['admins'])
- if uname.strip()]
+ uname.strip()
+ for uname in re.split(r'[,;\s]+', post_data['admins'])
+ if uname.strip()
+ ]
cc_usernames = [
- uname.strip() for uname in re.split('[,;\s]+', post_data['cc'])
- if uname.strip()]
+ uname.strip()
+ for uname in re.split(r'[,;\s]+', post_data['cc'])
+ if uname.strip()
+ ]
all_user_ids = services.user.LookupUserIDs(
mr.cnxn, admin_usernames + cc_usernames, autocreate=True)
@@ -48,7 +51,7 @@
continue
admin_id = all_user_ids[admin_name]
if admin_id not in admin_ids:
- admin_ids.append(admin_id)
+ admin_ids.append(admin_id)
cc_ids = []
for cc_name in cc_usernames:
@@ -60,8 +63,10 @@
cc_ids.append(cc_id)
label_strs = [
- lab.strip() for lab in re.split('[,;\s]+', post_data['labels'])
- if lab.strip()]
+ lab.strip()
+ for lab in re.split(r'[,;\s]+', post_data['labels'])
+ if lab.strip()
+ ]
label_ids = services.config.LookupLabelIDs(
mr.cnxn, mr.project_id, label_strs, autocreate=True)