Created
February 20, 2019 05:05
-
-
Save goltsevnet/32af52e5ef7f1d37061b05c17c26d6e4 to your computer and use it in GitHub Desktop.
Костыль
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
def status_page(request): | |
if request.method == 'POST': | |
-Магия- | |
email = request.POST.get('email') | |
# сумма которая списана с отправителя | |
withdraw_amount = request.POST.get('withdraw_amount') | |
a = f'{notification_type}&{operation_id}&{amount}&{currency}&{datetime}&{sender}&{codepro}&{notification_secret}&{label}' | |
sha1_hash2 = sha1(f'{a}'.encode('UTF8')).hexdigest() | |
if sha1_hash == sha1_hash2: | |
reason = False | |
reason_c = dict(REASON_CHOICES) | |
for k, v in reason_c.items(): | |
if v == notification_type: | |
reason = k | |
user_inst = Profile.objects.get(user=label) | |
UserBalanceChange.objects.create(user=user_inst.user, reason=reason, amount=amount, datetime=datetime) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment