Skip to content

Commit 72b9ec3

Browse files
committed
Linting cleanup
1 parent 5b53cfe commit 72b9ec3

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

src/pytito/admin/activity.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/pytito/admin/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ def _end_point(self) -> str:
5555
return super()._end_point + f'/{self._account_slug}/{self._event_slug}'
5656

5757
def _populate_json(self) -> None:
58-
self.__json_content = self._get_response(endpoint='')['event']
58+
self._json_content = self._get_response(endpoint='')['event']
5959
if self._json_content['_type'] != "event":
6060
raise ValueError('JSON content type was expected to be ticket')
6161

62-
def _update(self, payload: dict[str, Any]):
62+
def _update(self, payload: dict[str, Any]) -> None:
6363
self._patch_reponse(value={'event': payload})
6464
for key, value in payload.items():
6565
self._json_content[key] = value

src/pytito/admin/release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ def _populate_json(self) -> None:
5757
if self._json_content['_type'] != "release":
5858
raise ValueError('JSON content type was expected to be release')
5959

60-
def _update(self, payload: dict[str, Any]):
60+
def _update(self, payload: dict[str, Any]) -> None:
6161
self._patch_reponse(value={'release': payload})
6262
for key, value in payload.items():
6363
self._json_content[key] = value
6464

65-
def _update_slug(self, new_slug: str):
65+
def _update_slug(self, new_slug: str) -> None:
6666
"""
6767
The Slug is a unique component of the data used to reference the release in the API.
6868
It is sometimes desirable to change this

0 commit comments

Comments
 (0)