1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/endpoints/api/subscribe_models_pre_oci.py
2020-02-05 19:55:07 -08:00

25 lines
938 B
Python

from data.model.notification import create_unique_notification, delete_notifications_by_kind
from data.model.user import get_private_repo_count, get_user_or_org
from endpoints.api.subscribe_models_interface import SubscribeInterface
class PreOCIModel(SubscribeInterface):
"""
PreOCIModel implements the data model for build triggers using a database schema before it was
changed to support the OCI specification.
"""
def get_private_repo_count(self, username):
return get_private_repo_count(username)
def create_unique_notification(self, kind_name, target_username, metadata={}):
target = get_user_or_org(target_username)
create_unique_notification(kind_name, target, metadata)
def delete_notifications_by_kind(self, target_username, kind_name):
target = get_user_or_org(target_username)
delete_notifications_by_kind(target, kind_name)
data_model = PreOCIModel()