@@ -55,7 +55,7 @@ def _populate_json(self) -> None:
5555 if self ._json_content ['view' ] != 'extended' :
5656 raise ValueError ('expected the extended view of the ticket' )
5757
58- def _update (self , payload : dict [str , Any ]):
58+ def _update (self , payload : dict [str , Any ]) -> None :
5959 self ._patch_reponse (value = {'activity' : payload })
6060 for key , value in payload .items ():
6161 self ._json_content [key ] = value
@@ -84,6 +84,7 @@ def start_at(self) -> Optional[datetime]:
8484
8585 @start_at .setter
8686 def start_at (self , value : Optional [datetime ]) -> None :
87+ payload : dict [str , Any ]
8788 if value is None :
8889 if self .end_at is not None :
8990 raise RuntimeError ('The activity is not allowed end time without a start, '
@@ -94,7 +95,8 @@ def start_at(self, value: Optional[datetime]) -> None:
9495 self ._json_content ['start_at' ] = None
9596 else :
9697 if self .end_at is not None and self .end_at .date () != value .date ():
97- raise ValueError (f'The start_at and end_at must share a common date, you may need to set the end date to None to mke this change' )
98+ raise ValueError ('The start_at and end_at must share a common date, '
99+ 'you may need to set the end date to None to mke this change' )
98100 if self .end_at is not None and value >= self .end_at :
99101 raise ValueError (f'new start_at ({ value } ) is after the end_at ({ self .end_at } )' )
100102 # the start_at can not be changed directly, instead it is necessary to modify the
@@ -119,15 +121,17 @@ def end_at(self) -> Optional[datetime]:
119121
120122 @end_at .setter
121123 def end_at (self , value : Optional [datetime ]) -> None :
124+ payload : dict [str , Any ]
122125 if value is None :
123126 payload = {'end_time' : None }
124127 self ._patch_reponse (value = {'activity' : payload })
125128 self ._json_content ['end_at' ] = None
126129 else :
127130 if self .start_at is None :
128- raise ValueError ('An activity needs to have a start time to allow an end time to be sent, please configure the start_at first' )
131+ raise ValueError ('An activity needs to have a start time to allow an end time'
132+ ' to be sent, please configure the start_at first' )
129133 if self .start_at .date () != value .date ():
130- raise ValueError (f 'The start_at and end_at must share a common date' )
134+ raise ValueError ('The start_at and end_at must share a common date' )
131135 if value <= self .start_at :
132136 raise ValueError (f'new end_at ({ value } ) is before the start_at ({ self .start_at } )' )
133137 # the start_at can not be changed directly, instead it is necessary to modify the
0 commit comments