Commit 95925040 authored by 20after4's avatar 20after4
Browse files

Don't throw exception for invalid phids

Change-Id: Ie5066720450bf3c29930d385ce4ed17f73e59bd1
parent bde88022
......@@ -70,8 +70,6 @@ class PHID(str):
return PHObject.instance(self)
def __new__(cls, value: str) -> PHID:
if not value.startswith("PHID-"):
raise ValueError("PHIDs must start with PHID-")
return super().__new__(cls, value)
......@@ -401,7 +399,7 @@ def sql_convert_json(blob: bytes):
return json.loads(blob.decode("ascii"))
def sql_convert_phid(s: bytes) -> PHIDRef:
def sql_convert_phid(s: bytes) -> PHIDRef | str:
phid = PHID(s.decode("ascii"))
return PHIDRef(phid)
......@@ -565,7 +563,7 @@ class DataCache(object):
res.append(PHObject.instance(phid, data))
return res
def row(self, item: PHObject):
def row(self, item: PhabObjectBase):
row = list()
for col_name, col_type in self.cols():
if col_name == "data":
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment