Skip to content

Commit

Permalink
Refactor rest service to simplify inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-bellenghi committed Apr 12, 2024
1 parent d15739d commit f19c7ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
1.2.5 (unreleased)
------------------

- Nothing changed yet.
- Refactor rest service to simplify inheritance
[lucabel]


1.2.4 (2024-04-11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from plone.restapi.interfaces import ISerializeToJsonSummary
from plone.restapi.serializer.converters import json_compatible
from plone.restapi.services import Service
from urllib.parse import urlencode
from urllib.parse import unquote
from urllib.parse import urlencode
from zc.relation.interfaces import ICatalog
from zope.component import getMultiAdapter
from zope.component import getUtility
Expand Down Expand Up @@ -104,6 +104,9 @@ def get_uo_from_service_uid(self, uid):


class BookableUOList(BookableList):

UO_CONTENT_TYPE = "UnitaOrganizzativa"

def booking_type_check(self, prenotazioni_folder, booking_type):
if not booking_type:
return True
Expand Down Expand Up @@ -135,7 +138,7 @@ def reply(self):
"@id": f"{self.context.absolute_url()}/@bookable-uo-list",
"items": [],
}
query = dict(portal_type="UnitaOrganizzativa", sort_on="sortable_title")
query = dict(portal_type=self.UO_CONTENT_TYPE, sort_on="sortable_title")
uid = self.request.form.get("uid", "")
booking_type = self.request.form.get("booking_type", "")
if uid:
Expand Down

0 comments on commit f19c7ab

Please sign in to comment.