-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Hackathon Request] Support requests for hackathons anywhere in the w…
…orld!
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -1173,7 +1173,28 @@ def update_hackathon_volunteers(event_id, volunteer_type, json, propel_id): | |
return Message( | ||
"Updated Hackathon Volunteers" | ||
) | ||
|
||
|
||
def create_hackathon(json): | ||
db = get_db() # this connects to our Firestore database | ||
logger.debug("Hackathon Create") | ||
send_slack_audit(action="create_hackathon", message="Creating", payload=json) | ||
|
||
# Save payload for potential hackathon in the database under the hackathon_requests collection | ||
doc_id = uuid.uuid1().hex | ||
collection = db.collection('hackathon_requests') | ||
insert_res = collection.document(doc_id).set(json) | ||
|
||
if "contactEmail" in json and "contactName" in json: | ||
send_welcome_email(json["contactName"], json["contactEmail"]) | ||
|
||
send_slack( | ||
message=":rocket: New Hackathon Request :rocket: with json: " + str(json), channel="log-hackathon-requests", icon_emoji=":rocket:") | ||
logger.debug(f"Insert Result: {insert_res}") | ||
|
||
return Message( | ||
"Created Hackathon" | ||
) | ||
|
||
|
||
@limits(calls=50, period=ONE_MINUTE) | ||
def save_hackathon(json): | ||
|
@@ -1583,6 +1604,7 @@ def send_welcome_email(name, email): | |
params = { | ||
"from": "Opportunity Hack <[email protected]>", | ||
"to": f"{name} <{email}>", | ||
"bcc": "[email protected]", | ||
"subject": subject, | ||
"html": html_content, | ||
} | ||
|
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