Skip to content

Commit 71a51b1

Browse files
committed
Fix logger reference in Cheatsheets parser and add database existence check in update script
1 parent f2f85f4 commit 71a51b1

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

application/utils/external_project_parsers/parsers/cheatsheets_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def register_supplemental_cheatsheets(self, cache: db.Node_collection):
124124
)
125125
)
126126
except Exception as exc:
127-
logger.warning(
127+
self.logger.warning(
128128
"Failed to add supplemental cheatsheet link for cre_id=%s cre=%s section=%s: %s",
129129
cre_id,
130130
getattr(cre, "id", None),

scripts/update-cheatsheets.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ if ! python -c "import flask" >/dev/null 2>&1; then
1515
pip install -r "$ROOT_DIR/requirements.txt"
1616
fi
1717

18+
if [[ ! -f "$DB_PATH" ]]; then
19+
echo "Database file does not exist: $DB_PATH" >&2
20+
exit 1
21+
fi
22+
1823
BACKUP_FILE="${DB_PATH}.$(date +%Y%m%d%H%M%S).bak"
1924
cp "$DB_PATH" "$BACKUP_FILE"
2025
if [[ ! -f "$BACKUP_FILE" ]]; then

0 commit comments

Comments
 (0)