Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion credentials/apps/api/v2/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def wrapper(*args, **kwargs):
f"[{request.user.username}] originating from [{request.headers.get('host', 'Unknown')}] "
f"with data: [{data}]"
)
except Exception as exc:
except Exception as exc: # pylint: disable=broad-exception-caught
# catch overly broad exception to try to ensure if logging doesn't work the request will still be
# processed
logger.error(f"Error logging incoming request: {exc}. Continuing...")
Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/api/v2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def _replace_username_for_all_models(self, current_username, new_username, repla
num_rows_changed += model.objects.filter(**{column: current_username}).update(
**{column: new_username}
)
except Exception as exc:
except Exception as exc: # pylint: disable=broad-exception-caught
log.exception(
"Unable to change username from %s to %s. Failed on table %s because %s",
current_username,
Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/badges/credly/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from functools import lru_cache
from urllib.parse import urljoin

import requests # pylint: disable=unused-import
import requests
from attrs import asdict
from django.conf import settings
from django.contrib.sites.models import Site
Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_or_create_user_from_event_data(user_data):
# create the user if they don't exist, this follows similar behavior that our JWT authentication implements if
# a user doesn't exist when we're making network calls across services
user, created = User.objects.get_or_create(username=user_data.pii.username)
except Exception:
except Exception: # pylint: disable=broad-exception-caught
logger.exception("Error occurred retrieving or creating a user")
return None, None

Expand Down
4 changes: 2 additions & 2 deletions credentials/apps/credentials/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _update_or_create_credential(username, credential_type, credential_id, statu
credential_id=credential_id,
defaults={"status": status},
)
except Exception:
except Exception: # pylint: disable=broad-exception-caught
logger.exception(
f"Error occurred processing a credential with credential_id [{credential_id}] for user [{username}]"
)
Expand Down Expand Up @@ -128,7 +128,7 @@ def create_course_cert_config(course_run: "CourseRun", site: "Site", mode: str):
course_cert_config = _CourseCertificate.objects.create(
course_id=course_run.key, course_run=course_run, site=site, is_active=True, certificate_type=mode
)
except Exception:
except Exception: # pylint: disable=broad-exception-caught
logger.exception(f"Error occurred creating a CourseCertificate configuration for course run [{course_run.key}]")

return course_cert_config
Expand Down
2 changes: 1 addition & 1 deletion credentials/apps/credentials/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def send_program_certificate_created_message(
ace.send(msg)
# We wouldn't want any issues that arise from formatting or sending this email message to interrupt the process
# of issuing a learner their Program Certificate. We cast a wide net for exceptions here for this reason.
except Exception as ex:
except Exception as ex: # pylint: disable=broad-exception-caught
log.exception(
f"Unable to send email to learner with id: [{user.id}] for Program [{program_uuid}]. "
f"Error occurred while attempting to format or send message: {ex}"
Expand Down
7 changes: 4 additions & 3 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# SERIOUSLY.
#
# ------------------------------
# Generated by edx-lint version: 5.3.0
# Generated by edx-lint version: 5.6.0
# ------------------------------
[MASTER]
ignore = ,migrations, settings, wsgi.py
Expand Down Expand Up @@ -259,6 +259,7 @@ enable =
useless-suppression,
disable =
bad-indentation,
broad-exception-raised,
consider-using-f-string,
duplicate-code,
file-ignored,
Expand Down Expand Up @@ -380,6 +381,6 @@ ext-import-graph =
int-import-graph =

[EXCEPTIONS]
overgeneral-exceptions = Exception
overgeneral-exceptions = builtins.Exception

# c5ae18c461392d4da971ec11c4c38c26ac0da3e6
# f359d03cbb0162487655c0e4b6b09dd53da81787