Skip to content

Commit b14a1de

Browse files
authored
Merge pull request readthedocs#5664 from saadmk11/fix-lint-notification-restapi-config
pylint fix for notifications, restapi and config
2 parents baeed68 + 1f4a49c commit b14a1de

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

readthedocs/config/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from readthedocs.config.utils import to_dict
66

77

8-
class Base(object):
8+
class Base:
99

1010
"""
1111
Base class for every configuration.

readthedocs/notifications/notification.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,18 +168,16 @@ def get_message(self, success):
168168
else:
169169
# log the error but not crash
170170
log.error(
171-
"Notification {} has no key '{}' for {} messages".format(
172-
self.__class__.__name__,
173-
self.reason,
174-
'success' if self.success else 'failure',
175-
),
171+
"Notification %s has no key '%s' for %s messages",
172+
self.__class__.__name__,
173+
self.reason,
174+
'success' if self.success else 'failure',
176175
)
177176
else:
178177
log.error(
179-
'{}.{}_message is a dictionary but no reason was provided'.format(
180-
self.__class__.__name__,
181-
'success' if self.success else 'failure',
182-
),
178+
'%s.%s_message is a dictionary but no reason was provided',
179+
self.__class__.__name__,
180+
'success' if self.success else 'failure',
183181
)
184182
else:
185183
msg = message

readthedocs/restapi/views/model_views.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,11 @@ def sync_versions(self, request, **kwargs): # noqa: D205
219219
new_stable = project.get_stable_version()
220220
if promoted_version and new_stable and new_stable.active:
221221
log.info(
222-
'Triggering new stable build: {project}:{version}'.format(
223-
project=project.slug,
224-
version=new_stable.identifier,
225-
),
222+
'Triggering new stable build: %(project)s:%(version)s',
223+
{
224+
'project': project.slug,
225+
'version': new_stable.identifier,
226+
}
226227
)
227228
trigger_build(project=project, version=new_stable)
228229

0 commit comments

Comments
 (0)