From: Paul Hänsch Date: Mon, 18 Jan 2021 17:02:35 +0000 (+0100) Subject: remove course mapping when deleting card file X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=e371e98650cfda4c30865306d0f10949794911c9;p=confetti remove course mapping when deleting card file --- diff --git a/cards/update_card.sh b/cards/update_card.sh index 97dedf3..bf8bce1 100755 --- a/cards/update_card.sh +++ b/cards/update_card.sh @@ -131,6 +131,15 @@ case "$action" in delete) rm "$cardfile" RELEASE_SLOCK "$cardfile" + if LOCK "$attfile"; then + grep -F " ${card}" "$attfile" |while read course junk; do + touch "$_DATA/ical/${course}" + done + sed -i -E "/^.+ ${card}\$/d" "$attfile" + RELEASE "$attfile" + else + SET_COOKIE 0 message="COULD NOT UPDATE COURSE MAPPINGS" + fi REDIRECT "/cards/?o=${order}&f=${filter}" ;; esac