Skip to content

Commit efc9b40

Browse files
refactor(edx_sysadmin): log message improved when branch does not match with setting branch
1 parent 233cd78 commit efc9b40

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/edx_sysadmin/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ python_distribution(
2121
],
2222
provides=setup_py(
2323
name="edx-sysadmin",
24-
version="0.3.0",
24+
version="0.3.1",
2525
description="An Open edX plugin to enable SysAdmin panel",
2626
license="BSD-3-Clause",
2727
author="MIT Office of Digital Learning",

src/edx_sysadmin/api/views.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def post(self, request):
5858
err_msg = _("SYSADMIN_DEFAULT_BRANCH is not configured in settings")
5959
elif clean_pushed_branch != settings.SYSADMIN_DEFAULT_BRANCH:
6060
err_msg = _(
61-
"Couldn't entertain reload request for the branch ({}), expected branch is ({}) " # noqa: E501
61+
"Couldn't reload course from the branch ({}), expected branch was ({}) " # noqa: E501
6262
).format(clean_pushed_branch, settings.SYSADMIN_DEFAULT_BRANCH)
6363
else:
6464
repo = get_local_course_repo(repo_name)
@@ -93,8 +93,9 @@ def post(self, request):
9393
return self.get_reload_response(
9494
msg=msg, status_code=status.HTTP_200_OK
9595
)
96-
except Exception as e: # noqa: BLE001
96+
except Exception as e:
9797
err_msg = str(e)
98+
logger.exception(f"{self.__class__.__name__}:: {err_msg}") # noqa: G004
9899

99100
return self.get_reload_response(
100101
msg=err_msg, status_code=status.HTTP_400_BAD_REQUEST
@@ -104,7 +105,7 @@ def get_reload_response(self, msg, status_code):
104105
if status_code == status.HTTP_200_OK:
105106
logger.info(f"{self.__class__.__name__}:: {msg}") # noqa: G004
106107
else:
107-
logger.exception(f"{self.__class__.__name__}:: {msg}") # noqa: G004
108+
logger.debug(f"{self.__class__.__name__}:: {msg}") # noqa: G004
108109

109110
return Response(
110111
{"message": msg},

0 commit comments

Comments
 (0)