Skip to content

Commit

Permalink
Send Discord notification when SD mods get (un)locked (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett authored May 27, 2020
1 parent 5b7e048 commit 841cc91
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions netkan/netkan/webhooks/spacedock_inflate.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ def inflate_hook():
current_app.logger.error(
f'A SpaceDock mod has been deleted, affected netkans: {nk_msg}')
return '', 204
elif request.form.get('event_type') == 'locked':
# Just let the team know on Discord
nk_msg = ', '.join(nk.identifier for nk in nks)
current_app.logger.error(
f'A SpaceDock mod has been locked, affected netkans: {nk_msg}')
return '', 204
elif request.form.get('event_type') == 'unlocked':
# Just let the team know on Discord
nk_msg = ', '.join(nk.identifier for nk in nks)
current_app.logger.error(
f'A SpaceDock mod has been unlocked again, affected netkans: {nk_msg}')
return '', 204
else:
# Submit them to the queue
messages = (nk.sqs_message(current_app.config['ckm_repo'].group(nk.identifier))
Expand Down

0 comments on commit 841cc91

Please sign in to comment.