Merge branch 'main' into avm99963-monorail
Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266
GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/redirect/redirectissue.py b/redirect/redirectissue.py
new file mode 100644
index 0000000..00410a1
--- /dev/null
+++ b/redirect/redirectissue.py
@@ -0,0 +1,20 @@
+# Copyright 2023 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from google.appengine.ext import ndb
+
+
+class RedirectIssue(ndb.Model):
+ """Represents a issue redirect information."""
+ ProjectName = ndb.StringProperty()
+ MonorailLocalID = ndb.StringProperty()
+ RedirectID = ndb.StringProperty()
+
+ @classmethod
+ def Get(cls, project, issue_local_id):
+ key = project + ':' + str(issue_local_id)
+ redirect_issue_entity = ndb.Key('RedirectIssue', key).get()
+ if not redirect_issue_entity:
+ return None
+ return redirect_issue_entity.RedirectID