-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/eAbsentee/eAbsentee
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
This script is a scheduled call to the remind web endpoint. That endpoint emails group heads who have had their group code used in the past 24 hours with a reminder email to check the dashboard. You can follow through the code in the admin blueprint. | ||
This script should be scheduled daily. | ||
""" | ||
|
||
# test for local commit | ||
|
||
import os | ||
import sys | ||
import requests | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
os.chdir(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
|
||
# TODO: | ||
# 1) More secure storage of API key | ||
# 2) Post URL's shouldn't be public | ||
|
||
params = {'API_KEY': os.environ['API_KEY']} | ||
if os.environ['FLASK_DEBUG'] == 'True': | ||
requests.post('http://localhost:5000/api/remind/', params=params) | ||
else: | ||
requests.post('https://www.eabsentee.org/api/remind/', params=params) |