Skip to content

Commit

Permalink
#543 Add log to ya aviso view. Change order list fields set at admin …
Browse files Browse the repository at this point in the history
…panel (#544)
  • Loading branch information
duker33 authored Aug 25, 2018
1 parent cebb049 commit 8f7127f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shopelectro/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,11 @@ class OrderAdmin(mixins.PermissionsControl):

add = False
inlines = [PositionInline]
list_display = ['name', 'email', 'phone', 'address', 'city', 'payment_type', 'paid']
list_display = ['id', 'name', 'email', 'phone', 'total_price', 'payment_type', 'paid']
search_fields = ['name', 'email', 'phone']
list_display_links = ['name']


se_admin = SEAdminSite(name='se_admin')
se_admin.register(CustomPage, models.CustomPageAdmin)
se_admin.register(FlatPage, models.FlatPageAdmin)
Expand Down
6 changes: 6 additions & 0 deletions shopelectro/views/service.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
from hashlib import md5

from django.conf import settings
Expand All @@ -10,6 +11,9 @@

from shopelectro.models import Order

logger = logging.getLogger(__name__)


YANDEX_REQUEST_PARAM = (
'action', 'orderSumAmount', 'orderSumCurrencyPaycash', 'orderSumBankPaycash',
'shopId', 'invoiceId', 'customerNumber'
Expand Down Expand Up @@ -88,6 +92,8 @@ def send_mail_to_customer(order):
content_type='application/xhtml+xml'
)

logger.info(f'received yandex aviso. Aviso data: {request.POST}')

# maybe we can include django-annoying for such cases
# https://github.com/skorokithakis/django-annoying#get_object_or_none-function
try:
Expand Down

0 comments on commit 8f7127f

Please sign in to comment.