Skip to content

Commit

Permalink
Set all .ajax() calls content type, tweak logging
Browse files Browse the repository at this point in the history
* Verbose logging output
* Include email in ban-list alert
  • Loading branch information
rechner committed Feb 12, 2024
1 parent 91197b7 commit 18cd10f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 2 deletions.
17 changes: 16 additions & 1 deletion fm_eventmanager/settings.py.docker
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ DEBUG = os.getenv('DJANGO_DEBUG', False)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
'style': '{',
},
'simple': {
'format': '{levelname} {message}',
'style': '{',
},
},
'filters': {
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue',
Expand All @@ -71,15 +81,20 @@ LOGGING = {
'handlers': {
'console': {
'level': 'INFO',
'filters': ['require_debug_true'],
#'filters': ['require_debug_true'],
'class': 'logging.StreamHandler',
'formatter': 'verbose',
},
},
'loggers': {
'': {
'handlers': ['console'],
'level': 'DEBUG',
},
'django': {
'handlers': ['console'],
'propagate': True,
},
},
}

Expand Down
1 change: 1 addition & 0 deletions registration/templates/registration/attendee-locate.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ <h1>Registration Upgrade - {{ event }}</h1>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": "{% url 'registration:info_upgrade' %}",
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down
1 change: 1 addition & 0 deletions registration/templates/registration/attendee-upgrade.html
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ <h3 data-content="name"></h3>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": "{% url 'registration:add_upgrade' %}",
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down
2 changes: 2 additions & 0 deletions registration/templates/registration/checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ <h3>There are no attendees in your order</h3>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": URL_REGISTRATION_REMOVE_FROM_CART,
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down Expand Up @@ -414,6 +415,7 @@ <h3>There are no attendees in your order</h3>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": URL_REGISTRATION_DISCOUNT,
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down
2 changes: 2 additions & 0 deletions registration/templates/registration/onsite-checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ <h3>There are no attendees in your order</h3>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": "{% url 'registration:remove_from_cart' %}",
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down Expand Up @@ -196,6 +197,7 @@ <h3>There are no attendees in your order</h3>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": "{% url 'registration:checkout' %}",
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down
1 change: 1 addition & 0 deletions registration/templates/registration/onsite.html
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ <h3 data-content="name"></h3>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": "{% url 'registration:add_to_cart' %}",
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down
1 change: 1 addition & 0 deletions registration/templates/registration/registration-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ <h3 data-content="name"></h3>
$.ajax({
"type": "POST",
"dataType": "json",
"contentType": "application/json; charset=utf-8",
"url": "{% url 'registration:add_to_cart' %}",
"data": JSON.stringify(data),
"beforeSend": function (xhr, settings) {
Expand Down
2 changes: 1 addition & 1 deletion registration/views/cart.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def add_to_cart(request):

banCheck = check_ban_list(pda["firstName"], pda["lastName"], pda["email"])
if banCheck:
logger.error("***ban list registration attempt***")
logger.error(f"***ban list registration attempt: {pda['email']}***")
registrationEmail = common.get_registration_email()
return common.abort(
403,
Expand Down

0 comments on commit 18cd10f

Please sign in to comment.