Merge branch 'main' into avm99963-monorail

Merged commit cd4b3b336f1f14afa02990fdc2eec5d9467a827e

GitOrigin-RevId: e67bbf185d5538e1472bb42e0abb2a141f88bac1
diff --git a/tracker/issuebulkedit.py b/tracker/issuebulkedit.py
index c1f5229..3ea4d3f 100644
--- a/tracker/issuebulkedit.py
+++ b/tracker/issuebulkedit.py
@@ -14,7 +14,7 @@
 from __future__ import absolute_import
 
 import collections
-import httplib
+from six.moves import http_client
 import itertools
 import logging
 import time
@@ -24,6 +24,7 @@
 from features import filterrules_helpers
 from features import send_notifications
 from framework import exceptions
+from framework import flaskservlet
 from framework import framework_constants
 from framework import framework_views
 from framework import permissions
@@ -41,7 +42,7 @@
   """IssueBulkEdit lists multiple issues and allows an edit to all of them."""
 
   _PAGE_TEMPLATE = 'tracker/issue-bulk-edit-page.ezt'
-  _MAIN_TAB_MODE = servlet.Servlet.MAIN_TAB_ISSUES
+  _MAIN_TAB_MODE = flaskservlet.FlaskServlet.MAIN_TAB_ISSUES
   _SECONDS_OVERHEAD = 4
   _SECONDS_PER_UPDATE = 0.12
   _SLOWNESS_THRESHOLD = 10
@@ -170,31 +171,41 @@
     """
     if not mr.local_id_list:
       logging.info('missing issue local IDs, probably tampered')
-      self.response.status = httplib.BAD_REQUEST
+      #TODO: switch when convert /p to flask
+      # self.response.status_code = http_client.BAD_REQUEST
+      self.response.status = http_client.BAD_REQUEST
       return
 
     # Check that the user is logged in; anon users cannot update issues.
     if not mr.auth.user_id:
       logging.info('user was not logged in, cannot update issue')
-      self.response.status = httplib.BAD_REQUEST  # xxx should raise except
+      #TODO: switch when convert /p to flask
+      # self.response.status_code = http_client.BAD_REQUEST
+      self.response.status = http_client.BAD_REQUEST
       return
 
     # Check that the user has permission to add a comment, and to enter
     # metadata if they are trying to do that.
     if not self.CheckPerm(mr, permissions.ADD_ISSUE_COMMENT):
       logging.info('user has no permission to add issue comment')
-      self.response.status = httplib.BAD_REQUEST
+      #TODO: switch when convert /p to flask
+      # self.response.status_code = http_client.BAD_REQUEST
+      self.response.status = http_client.BAD_REQUEST
       return
 
     if not self.CheckPerm(mr, permissions.EDIT_ISSUE):
       logging.info('user has no permission to edit issue metadata')
-      self.response.status = httplib.BAD_REQUEST
+      #TODO: switch when convert /p to flask
+      # self.response.status_code = http_client.BAD_REQUEST
+      self.response.status = http_client.BAD_REQUEST
       return
 
     move_to = post_data.get('move_to', '').lower()
     if move_to and not self.CheckPerm(mr, permissions.DELETE_ISSUE):
       logging.info('user has no permission to move issue')
-      self.response.status = httplib.BAD_REQUEST
+      #TODO: switch when convert /p to flask
+      # self.response.status_code = http_client.BAD_REQUEST
+      self.response.status = http_client.BAD_REQUEST
       return
 
     config = self.services.config.GetProjectConfig(mr.cnxn, mr.project_id)
@@ -471,3 +482,9 @@
     # TODO(jrobbins): implement bulk=N param for a better confirmation alert.
     return tracker_helpers.FormatIssueListURL(
         mr, config, saved=len(mr.local_id_list), ts=int(time.time()))
+
+  # def GetIssueBulkEdit(self, **kwargs):
+  #   return self.handler(**kwargs)
+
+  # def PostIssueBulkEdit(self, **kwargs):
+  #   return self.handler(**kwargs)