Skip to content

Commit

Permalink
Remove LayerMinimalView
Browse files Browse the repository at this point in the history
  • Loading branch information
bkis committed Aug 21, 2023
1 parent 613f4af commit 82fe9dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
5 changes: 0 additions & 5 deletions Tekst-API/tekst/models/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
Metadata,
ModelBase,
ModelFactoryMixin,
ReadBase,
)
from tekst.models.user import UserRead

Expand Down Expand Up @@ -126,10 +125,6 @@ class Settings(DocumentBase.Settings):
LayerBaseUpdate = LayerBase.get_update_model()


class LayerMinimalView(ReadBase):
layer_type: str


class LayerNodeCoverage(ModelBase):
label: str
position: int
Expand Down
12 changes: 4 additions & 8 deletions Tekst-API/tekst/routers/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from tekst.auth import OptionalUserDep, UserDep
from tekst.layer_types import layer_type_manager
from tekst.models.layer import LayerBaseDocument, LayerMinimalView
from tekst.models.layer import LayerBaseDocument
from tekst.models.unit import UnitBase, UnitBaseDocument


Expand Down Expand Up @@ -192,13 +192,9 @@ async def find_units(
returned unit objects cannot be typed to their precise layer unit type.
"""

readable_layers = (
await LayerBaseDocument.find(
LayerBaseDocument.allowed_to_read(user), with_children=True
)
.project(LayerMinimalView)
.to_list()
)
readable_layers = await LayerBaseDocument.find(
LayerBaseDocument.allowed_to_read(user), with_children=True
).to_list()
readable_layer_ids = [layer.id for layer in readable_layers]

units = (
Expand Down

0 comments on commit 82fe9dd

Please sign in to comment.