@@ -151,22 +151,38 @@ def get_maintenances(self, data: NotificationData) -> Iterable[Maintenance]:
151151 @classmethod
152152 def get_default_organizer (cls ) -> str :
153153 """Expose default_organizer as class attribute."""
154- return cls ._default_organizer .get_default () # type: ignore
154+ try :
155+ return cls ._default_organizer .get_default () # type: ignore
156+ except AttributeError :
157+ # TODO: This exception handling is required for Pydantic 1.x compatibility. To be removed when the dependency is deprecated.
158+ return cls ._default_organizer
155159
156160 @classmethod
157161 def get_default_processors (cls ) -> List [GenericProcessor ]:
158162 """Expose default_processors as class attribute."""
159- return cls ._processors .get_default () # type: ignore
163+ try :
164+ return cls ._processors .get_default () # type: ignore
165+ except AttributeError :
166+ # TODO: This exception handling is required for Pydantic 1.x compatibility. To be removed when the dependency is deprecated.
167+ return cls ._processors
160168
161169 @classmethod
162170 def get_default_include_filters (cls ) -> Dict [str , List [str ]]:
163171 """Expose include_filter as class attribute."""
164- return cls ._include_filter .get_default () # type: ignore
172+ try :
173+ return cls ._include_filter .get_default () # type: ignore
174+ except AttributeError :
175+ # TODO: This exception handling is required for Pydantic 1.x compatibility. To be removed when the dependency is deprecated.
176+ return cls ._include_filter
165177
166178 @classmethod
167179 def get_default_exclude_filters (cls ) -> Dict [str , List [str ]]:
168180 """Expose exclude_filter as class attribute."""
169- return cls ._exclude_filter .get_default () # type: ignore
181+ try :
182+ return cls ._exclude_filter .get_default () # type: ignore
183+ except AttributeError :
184+ # TODO: This exception handling is required for Pydantic 1.x compatibility. To be removed when the dependency is deprecated.
185+ return cls ._exclude_filter
170186
171187 @classmethod
172188 def get_extended_data (cls ):
0 commit comments