Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URB-2993: Add fusion method getValidityEndDate #255

Open
wants to merge 1 commit into
base: urban2.7.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/URB-2993.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add fusion method getValidityEndDate
[daggelpop]
10 changes: 10 additions & 0 deletions src/Products/urban/content/licence/GenericLicence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,16 @@ def getLastEventWithValidityDate(self):
return None
return events[-1]

def getValidityEndDate(self):
"""
Get the last "validity end date" found in any of the licence's events, or nothing.
"""
validity_event = self.getLastEventWithValidityDate()
if validity_event:
return validity_event.getValidityEndDate()
else:
return None

def get_bound_roaddecrees(self):
roaddecrees = []
annotations = IAnnotations(self)
Expand Down