remove long comment
This commit is contained in:
parent
7575e8ccc9
commit
30d7606ea5
@ -213,94 +213,6 @@ def change_racer(request):
|
|||||||
return HttpResponse('{"reason":"Nějaký údaj chybí!"}', status=400, content_type='application/json')
|
return HttpResponse('{"reason":"Nějaký údaj chybí!"}', status=400, content_type='application/json')
|
||||||
|
|
||||||
|
|
||||||
#@csrf_exempt
|
|
||||||
#def register(request):
|
|
||||||
# ALKATOR_CLASS = 2
|
|
||||||
#
|
|
||||||
# if date.today() >= date(2024, 10, 5):
|
|
||||||
# return HttpResponse('{"reason":"Too late!"}', status=400, content_type='application/json')
|
|
||||||
# if not request.POST.get('agreement'):
|
|
||||||
# return HttpResponse('{"reason":"Je potřeba souhlasit se zpracováním údajů!"}', status=400, content_type='application/json')
|
|
||||||
# if not request.POST['first_name']:
|
|
||||||
# return HttpResponse('{"reason":"Jméno je povinné!"}', status=400, content_type='application/json')
|
|
||||||
# if not request.POST['last_name']:
|
|
||||||
# return HttpResponse('{"reason":"Přijmení je povinné!"}', status=400, content_type='application/json')
|
|
||||||
# if not request.POST['email']:
|
|
||||||
# return HttpResponse('{"reason":"Email je povinný!"}', status=400, content_type='application/json')
|
|
||||||
# if not request.POST['address']:
|
|
||||||
# return HttpResponse('{"reason":"Adresa je povinná!"}', status=400, content_type='application/json')
|
|
||||||
# if not request.POST['phone']:
|
|
||||||
# return HttpResponse('{"reason":"Telefoní číslo je povinný!"}', status=400, content_type='application/json')
|
|
||||||
# if User.objects.filter(email=request.POST['email'], alkator_class=ALKATOR_CLASS):
|
|
||||||
# return HttpResponse('{"reason":"Email je již registrován!"}', status=400, content_type='application/json')
|
|
||||||
# if User.objects.filter(alkator_class=ALKATOR_CLASS, paid=True).count() >= 50:
|
|
||||||
# return HttpResponse('{"reason":"Kapacita závodu byla naplněna!"}', status=400, content_type='application/json')
|
|
||||||
# try:
|
|
||||||
# dat = datetime.strptime(request.POST['date_of_birth'], "%Y-%m-%d").date()
|
|
||||||
# if dat > date(2006, 10, 5):
|
|
||||||
# return HttpResponse('{"reason":"Je potřeba mít 18 let v den závodu!"}', status=400, content_type='application/json')
|
|
||||||
# elif dat < date(1924, 10, 5):
|
|
||||||
# return HttpResponse('{"reason":"Opravdu vám je 100 let?"}', status=400, content_type='application/json')
|
|
||||||
# except:
|
|
||||||
# return HttpResponse('{"reason":"Špatný formát datu narození!"}', status=400, content_type='application/json')
|
|
||||||
#
|
|
||||||
# invoice_date = datetime.today()
|
|
||||||
# invoice_id = invoice_date.year * 1000000 + invoice_date.month * 10000 + invoice_date.day * 100
|
|
||||||
#
|
|
||||||
# try:
|
|
||||||
# latest_user = User.objects.latest("invoice_id")
|
|
||||||
# if latest_user.invoice_id is None or latest_user.invoice_id < invoice_id:
|
|
||||||
# invoice_id = invoice_id + 1
|
|
||||||
# else:
|
|
||||||
# invoice_id = latest_user.invoice_id + 1
|
|
||||||
# except User.DoesNotExist:
|
|
||||||
# invoice_id = invoice_id + 1
|
|
||||||
#
|
|
||||||
# if date.today() >= date(2024, 9, 21):
|
|
||||||
# price = 79000
|
|
||||||
# else:
|
|
||||||
# price = 69000
|
|
||||||
#
|
|
||||||
# user = User(
|
|
||||||
# first_name=request.POST['first_name'],
|
|
||||||
# last_name=request.POST['last_name'],
|
|
||||||
# email=request.POST['email'],
|
|
||||||
# date_of_birth=dat,
|
|
||||||
# address=request.POST['address'],
|
|
||||||
# phone=request.POST['phone'],
|
|
||||||
# alkator_class=ALKATOR_CLASS,
|
|
||||||
# invoice_id=invoice_id,
|
|
||||||
# price=price//100
|
|
||||||
# )
|
|
||||||
# user.save()
|
|
||||||
#
|
|
||||||
# payment_data = {
|
|
||||||
# 'merchant': COMGATE_MERCHANT,
|
|
||||||
# 'test': 'true' if COMGATE_TEST else 'false',
|
|
||||||
# 'price': price,
|
|
||||||
# 'curr': 'CZK',
|
|
||||||
# 'method': 'ALL',
|
|
||||||
# 'label': 'Startovné na závod Alkátor Race Studené 2024',
|
|
||||||
# 'email': user.email,
|
|
||||||
# 'fullName': f"{user.first_name} {user.last_name}",
|
|
||||||
# 'refId': f'{user.invoice_id}',
|
|
||||||
# 'secret': COMGATE_SECRET,
|
|
||||||
# 'prepareOnly': 'true',
|
|
||||||
# }
|
|
||||||
# result = requests.post('https://payments.comgate.cz/v1.0/create', data=payment_data)
|
|
||||||
#
|
|
||||||
# result = parse_qs(result.text)
|
|
||||||
#
|
|
||||||
# if result['code'][0] != '0':
|
|
||||||
# user.delete()
|
|
||||||
# return HttpResponse('{"reason":"Chyba na straně platební brány: ' + result['message'][0] + ', zkuste prosím registraci později."}', status=400, content_type='application/json')
|
|
||||||
#
|
|
||||||
# user.trans_id = result['transId'][0]
|
|
||||||
# user.save()
|
|
||||||
#
|
|
||||||
# return HttpResponse('{"success":"", "redirect":"' + result['redirect'][0] + '"}', content_type='application/json')
|
|
||||||
|
|
||||||
|
|
||||||
@csrf_exempt
|
@csrf_exempt
|
||||||
def payment_result(request):
|
def payment_result(request):
|
||||||
result = parse_qs(request.body.decode('utf8'))
|
result = parse_qs(request.body.decode('utf8'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user