11 lines
318 B
Python
11 lines
318 B
Python
from app.core.content.content_id import ContentId
|
|
|
|
|
|
def resolve_content(content_id) -> ContentId: # -> [content, error]
|
|
if isinstance(content_id, ContentId):
|
|
return content_id, None
|
|
try:
|
|
return ContentId.deserialize(content_id), None
|
|
except BaseException as e:
|
|
return None, f"{e}"
|