change name rent resource for assigned

This commit is contained in:
Cayo Puigdefabregas 2020-11-18 11:31:23 +01:00
parent 69368a8ca3
commit 64fe93491c
5 changed files with 12 additions and 11 deletions

View File

@ -14,7 +14,7 @@ from ereuse_devicehub.resources.device import definitions
from ereuse_devicehub.resources.documents import documents from ereuse_devicehub.resources.documents import documents
from ereuse_devicehub.resources.enums import PriceSoftware from ereuse_devicehub.resources.enums import PriceSoftware
from ereuse_devicehub.resources.versions import versions from ereuse_devicehub.resources.versions import versions
from ereuse_devicehub.resources.rent import definitions as rent_def from ereuse_devicehub.resources.assigned import definitions as assigned_def
class DevicehubConfig(Config): class DevicehubConfig(Config):
@ -29,7 +29,7 @@ class DevicehubConfig(Config):
import_resource(documents), import_resource(documents),
import_resource(inventory), import_resource(inventory),
import_resource(versions), import_resource(versions),
import_resource(rent_def)), import_resource(assigned_def)),
) )
PASSWORD_SCHEMES = {'pbkdf2_sha256'} # type: Set[str] PASSWORD_SCHEMES = {'pbkdf2_sha256'} # type: Set[str]
DB_USER = config('DB_USER', 'dhub') DB_USER = config('DB_USER', 'dhub')

View File

@ -0,0 +1,9 @@
from typing import Callable, Iterable, Tuple
from ereuse_devicehub.resources.action import schemas
from teal.resource import Resource
from ereuse_devicehub.resources.assigned.views import AssignedView
class AssignedDef(Resource):
VIEW = AssignedView
SCHEMA = schemas.Assigned

View File

@ -10,7 +10,7 @@ from ereuse_devicehub.query import things_response
from ereuse_devicehub.resources.action.models import Assigned from ereuse_devicehub.resources.action.models import Assigned
class RentingView(View): class AssignedView(View):
@auth.Auth.requires_auth @auth.Auth.requires_auth
def get(self, id: uuid.UUID) -> Assigned: def get(self, id: uuid.UUID) -> Assigned:
return super().get(id) return super().get(id)

View File

@ -1,8 +0,0 @@
from ereuse_devicehub.resources.action import schemas
from teal.resource import Resource
from ereuse_devicehub.resources.rent.views import RentingView
class RentDef(Resource):
VIEW = RentingView
SCHEMA = schemas.Assigned