Skip to content

Commit

Permalink
chore: fix ruff errors (PGH002, UP032)
Browse files Browse the repository at this point in the history
  • Loading branch information
afuetterer authored and MyPyDavid committed Nov 23, 2023
1 parent e4cdaab commit d2b078f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions rdmo/projects/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ def save_import_snapshot_values(project, snapshots, checked):

for value in snapshot.snapshot_values:
if value.attribute:
value_key = '{value.attribute.uri}[{snapshot_index}][{value.set_prefix}][{value.set_index}][{value.collection_index}]'.format( # noqa: E501
value=value,
snapshot_index=snapshot.snapshot_index
)
value_key = f"{value.attribute.uri}[{snapshot.snapshot_index}][{value.set_prefix}][{value.set_index}][{value.collection_index}]" # noqa: E501

if value_key in checked:
# assert that this is a new value
Expand Down
8 changes: 4 additions & 4 deletions rdmo/services/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def get(self, request, url):
response = requests.get(url, headers=self.get_authorization_headers(access_token))

if response.status_code == 401:
logger.warn('get forbidden: %s (%s)', response.content, response.status_code)
logger.warning('get forbidden: %s (%s)', response.content, response.status_code)
else:
try:
response.raise_for_status()
return self.get_success(request, response)

except requests.HTTPError:
logger.warn('get error: %s (%s)', response.content, response.status_code)
logger.warning('get error: %s (%s)', response.content, response.status_code)

return render(request, 'core/error.html', {
'title': _('OAuth error'),
Expand All @@ -53,14 +53,14 @@ def post(self, request, url, data):
response = requests.post(url, json=data, headers=self.get_authorization_headers(access_token))

if response.status_code == 401:
logger.warn('post forbidden: %s (%s)', response.content, response.status_code)
logger.warning('post forbidden: %s (%s)', response.content, response.status_code)
else:
try:
response.raise_for_status()
return self.post_success(request, response)

except requests.HTTPError:
logger.warn('post error: %s (%s)', response.content, response.status_code)
logger.warning('post error: %s (%s)', response.content, response.status_code)

return render(request, 'core/error.html', {
'title': _('OAuth error'),
Expand Down

0 comments on commit d2b078f

Please sign in to comment.