Skip to content

Commit

Permalink
Inherit Booking moved event from the ObjectModifiedEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Jan 9, 2024
1 parent 3e14087 commit dba57a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
30 changes: 0 additions & 30 deletions src/redturtle/prenotazioni/content/prenotazione.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,12 @@ def getBooking_date(self):

def setBooking_date(self, date):
self.booking_date = date
return

def getBooking_expiration_date(self):
return self.booking_expiration_date

def setBooking_expiration_date(self, date):
self.booking_expiration_date = date
return

def getBooking_type(self):
return self.booking_type
Expand Down Expand Up @@ -267,37 +265,9 @@ def getBookingCode(self):

def canAccessBooking(self):
return True
# creator = self.Creator()
# if api.user.is_anonymous():
# if creator:
# return False
# else:
# current_user = api.user.get_current()
# if (
# not api.user.has_permission("redturtle.prenotazioni.ManagePrenotazioni")
# and creator != current_user.getUserName()
# ):
# return False
# return True

def canDeleteBooking(self):
return True
# creator = self.Creator()
# if not creator:
# if api.user.is_anonymous():
# return True
# if api.user.has_permission("redturtle.prenotazioni.ManagePrenotazioni"):
# return True
# else:
# if api.user.is_anonymous():
# return False
# current_user = api.user.get_current()
# if (
# api.user.has_permission("redturtle.prenotazioni.ManagePrenotazioni")
# or creator == current_user.getUserName()
# ):
# return True
# return False

def get_booking_type(self):
return {
Expand Down
8 changes: 4 additions & 4 deletions src/redturtle/prenotazioni/prenotazione_event.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# -*- coding: utf-8 -*-
from zope.interface import implementer
from zope.interface.interfaces import IObjectEvent
from zope.interface.interfaces import ObjectEvent
from zope.lifecycleevent import ObjectModifiedEvent
from zope.lifecycleevent.interfaces import IObjectModifiedEvent


class IMovedPrenotazione(IObjectEvent):
class IMovedPrenotazione(IObjectModifiedEvent):

"""Marker interface for prenotazione that is moved"""


@implementer(IMovedPrenotazione)
class MovedPrenotazione(ObjectEvent):
class MovedPrenotazione(ObjectModifiedEvent):

"""Event fired when a prenotazione that is moved"""

Expand Down

0 comments on commit dba57a5

Please sign in to comment.