removed the address and updated the logging
This commit is contained in:
@@ -62,7 +62,6 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-6 mb-4 mb-lg-0">
|
<div class="col-lg-6 mb-4 mb-lg-0">
|
||||||
<h5 class="text-uppercase mb-4">Stonehedge Community Homeowners Association</h5>
|
<h5 class="text-uppercase mb-4">Stonehedge Community Homeowners Association</h5>
|
||||||
<p class="text-white-50">1900 Spring Rd. #200<br>Oak Brook, IL 60523</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-4 offset-lg-2 mb-4 mb-lg-0">
|
<div class="col-lg-4 offset-lg-2 mb-4 mb-lg-0">
|
||||||
<h5 class="text-uppercase mb-4">Quick Links</h5>
|
<h5 class="text-uppercase mb-4">Quick Links</h5>
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ from django.views.decorators.csrf import csrf_exempt # new
|
|||||||
from django.contrib.auth import logout, authenticate, login
|
from django.contrib.auth import logout, authenticate, login
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
import stripe
|
import stripe
|
||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
print(__name__)
|
||||||
"""
|
"""
|
||||||
Strip Stuff
|
Strip Stuff
|
||||||
Tutorial: https://testdriven.io/blog/django-stripe-tutorial/
|
Tutorial: https://testdriven.io/blog/django-stripe-tutorial/
|
||||||
@@ -191,11 +195,11 @@ def membership_form2(request):
|
|||||||
"state": request.POST.get("state", "IL"),
|
"state": request.POST.get("state", "IL"),
|
||||||
"zip_code": request.POST.get("zipCode", "60189"),
|
"zip_code": request.POST.get("zipCode", "60189"),
|
||||||
}
|
}
|
||||||
print(address_data)
|
logging.debug(address_data)
|
||||||
addressForm = AddressForm(address_data)
|
addressForm = AddressForm(address_data)
|
||||||
print(f"is addressForm valid: {addressForm.is_valid()}")
|
logging.debug(f"is addressForm valid: {addressForm.is_valid()}")
|
||||||
if not addressForm.is_valid():
|
if not addressForm.is_valid():
|
||||||
print(f"addressForm Errors: {addressForm.errors}")
|
logging.error(f"addressForm Errors: {addressForm.errors}")
|
||||||
|
|
||||||
services_data = {
|
services_data = {
|
||||||
"babysitting": True if request.POST.get("babysitting", "") == "on" else False,
|
"babysitting": True if request.POST.get("babysitting", "") == "on" else False,
|
||||||
@@ -243,20 +247,20 @@ def membership_form2(request):
|
|||||||
|
|
||||||
peopleForm1 = PeopleForm(person1_data)
|
peopleForm1 = PeopleForm(person1_data)
|
||||||
peopleForm2 = PeopleForm(person2_data)
|
peopleForm2 = PeopleForm(person2_data)
|
||||||
|
|
||||||
|
|
||||||
|
logging.debug("Validating the captcha form")
|
||||||
print("Validating the captcha form")
|
logging.debug(request.POST.get("captcha",""))
|
||||||
print(request.POST.get("captcha",""))
|
|
||||||
captchaForm = CaptchaForm({
|
captchaForm = CaptchaForm({
|
||||||
"captcha": request.POST.get("captcha","")
|
"captcha": request.POST.get("captcha","")
|
||||||
})
|
})
|
||||||
print(f"Captch form is: {captchaForm.is_valid()}")
|
logging.debug(f"Captch form is: {captchaForm.is_valid()}")
|
||||||
|
|
||||||
|
|
||||||
print(f"peopleForm1 form is: {peopleForm1.is_valid()}")
|
logging.debug(f"peopleForm1 form is: {peopleForm1.is_valid()}")
|
||||||
print(f"peopleForm2 form is: {peopleForm2.is_valid()}")
|
logging.debug(f"peopleForm2 form is: {peopleForm2.is_valid()}")
|
||||||
print(f"servicesForm form is: {servicesForm.is_valid()}")
|
logging.debug(f"servicesForm form is: {servicesForm.is_valid()}")
|
||||||
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
addressForm.is_valid()
|
addressForm.is_valid()
|
||||||
@@ -266,7 +270,7 @@ def membership_form2(request):
|
|||||||
and captchaForm.is_valid()
|
and captchaForm.is_valid()
|
||||||
):
|
):
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
print("starting to save")
|
logging.debug("starting to save")
|
||||||
try:
|
try:
|
||||||
membership = Membership.objects.create()
|
membership = Membership.objects.create()
|
||||||
|
|
||||||
@@ -292,12 +296,12 @@ def membership_form2(request):
|
|||||||
address_obj.membership = membership
|
address_obj.membership = membership
|
||||||
address_obj.save()
|
address_obj.save()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
logging.error(e)
|
||||||
|
|
||||||
return redirect("index2")
|
return redirect("index2")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Some field is not valid")
|
logging.warning("Some field is not valid")
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"schasite/membership_form2.html",
|
"schasite/membership_form2.html",
|
||||||
@@ -474,6 +478,7 @@ def membership_form(request):
|
|||||||
def scha_board(request):
|
def scha_board(request):
|
||||||
return render(request, "schasite/scha_board.html", {})
|
return render(request, "schasite/scha_board.html", {})
|
||||||
|
|
||||||
|
|
||||||
def login(request):
|
def login(request):
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
|
|||||||
Reference in New Issue
Block a user