-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Trey <[email protected]>
- Loading branch information
Showing
8 changed files
with
584 additions
and
467 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,32 @@ | ||
from textwrap import dedent | ||
|
||
from django.contrib import messages | ||
from login_required import login_not_required | ||
|
||
from backend.models import InvoiceProduct | ||
from backend.service import BOTO3_HANDLER | ||
from backend.types.requests import WebRequest | ||
|
||
from django.http import HttpResponse | ||
|
||
|
||
@login_not_required | ||
def join_waitlist_endpoint(request: WebRequest): | ||
email_address = request.POST.get("email", "") | ||
name = request.POST.get("name", "") | ||
|
||
if not email_address: | ||
return HttpResponse(status=400) | ||
|
||
if not BOTO3_HANDLER.initiated: | ||
return HttpResponse(status=500) | ||
|
||
BOTO3_HANDLER.dynamodb_client.put_item(TableName="myfinances-emails", Item={"email": {"S": email_address}, "name": {"S": name}}) | ||
|
||
content = """ | ||
<div class='text-success'> | ||
Successfully registered! Expect some discounts and updates as we progress in our journey :) | ||
</div> | ||
""" | ||
|
||
return HttpResponse(status=200, content=dedent(content).strip()) |
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,8 @@ | ||
from django.urls import path | ||
from . import email_waitlist | ||
|
||
urlpatterns = [ | ||
path("join_waitlist/", email_waitlist.join_waitlist_endpoint, name="join_waitlist"), | ||
] | ||
|
||
app_name = "landing_page" |
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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