diff --git a/news/URB-2993.feature b/news/URB-2993.feature new file mode 100644 index 000000000..d4c9debe1 --- /dev/null +++ b/news/URB-2993.feature @@ -0,0 +1,2 @@ +Add fusion method getValidityEndDate +[daggelpop] \ No newline at end of file diff --git a/src/Products/urban/content/licence/GenericLicence.py b/src/Products/urban/content/licence/GenericLicence.py index 7b71b335b..cd582418c 100755 --- a/src/Products/urban/content/licence/GenericLicence.py +++ b/src/Products/urban/content/licence/GenericLicence.py @@ -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)