1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/endpoints/common_models_pre_oci.py
Kenny Lee Sin Cheong 5f63b3a7bb chore: drop deprecated tables and remove unused code (PROJQUAY-522) (#2089)
* chore: drop deprecated tables and remove unused code

* isort imports

* migration: check for table existence before drop
2023-08-25 12:17:24 -04:00

30 lines
828 B
Python

from data import model
from endpoints.common_models_interface import EndpointsCommonDataInterface, User
class EndpointsCommonDataPreOCIModel(EndpointsCommonDataInterface):
def get_user(self, user_uuid):
user = model.user.get_user_by_uuid(user_uuid)
if user is None:
return None
return User(
uuid=user.uuid,
username=user.username,
email=user.email,
given_name=user.given_name,
family_name=user.family_name,
company=user.company,
location=user.location,
)
def get_namespace_uuid(self, namespace_name):
user = model.user.get_namespace_user(namespace_name)
if user is None:
return None
return user.uuid
pre_oci_model = EndpointsCommonDataPreOCIModel()