blob: 00410a17921feed05695131a9140d695df6db78d [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001# Copyright 2023 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from google.appengine.ext import ndb
6
7
8class RedirectIssue(ndb.Model):
9 """Represents a issue redirect information."""
10 ProjectName = ndb.StringProperty()
11 MonorailLocalID = ndb.StringProperty()
12 RedirectID = ndb.StringProperty()
13
14 @classmethod
15 def Get(cls, project, issue_local_id):
16 key = project + ':' + str(issue_local_id)
17 redirect_issue_entity = ndb.Key('RedirectIssue', key).get()
18 if not redirect_issue_entity:
19 return None
20 return redirect_issue_entity.RedirectID