Source code for luna_configurator.app.handlers.limitations_handler

# -*- coding: utf-8 -*-
"""Limitations Handler

Module realize limitations handler.
"""

from sanic.response import HTTPResponse

from app.handlers.base_handler import BaseRequestHandler
from crutches_on_wheels.web.query_getters import listStringsGetter


[docs]class LimitationsHandler(BaseRequestHandler): """ Handler for settings' limitations. """
[docs] async def get(self) -> HTTPResponse: """ Request to receive settings limitations. See `spec getLimitations`_. .. _`spec getLimitations`: _static/api.html#operation/getLimitations """ description = self.getQueryParam("description") limitationNames = self.getQueryParam("limitation_names", listStringsGetter) groupNames = self.getQueryParam("group_names", listStringsGetter) response = await self.dbContext.getLimitations(limitationNames, description, groupNames) return self.success(200, outputJson=response)