<commit_before># index/signals.py

from datetime import datetime

from ultimate.leagues.models import League, Registrations

from paypal.standard.ipn.signals import payment_was_successful

def payment_success(sender, **kwargs):
	ipn_obj = sender

	print 'PayPal IPN Incoming: ' + ipn_obj.invoice

	try:
		registration = Registrations.objects.get(paypal_invoice_id=ipn_obj.invoice)

		if registration.league.is_waitlist(registration.user):
			registration.waitlist = 1

		registration.paypal_complete = 1
		registration.registered = datetime.now()
		registration.save()

		print 'PayPal IPN Success: ' + ipn_obj.invoice
	except Registrations.DoesNotExist:
		print 'PayPal IPN Error: ' + ipn_obj.invoice + ' - Registration does not exist'
	except Exception, e:
		print 'PayPal IPN Error: ' + ipn_obj.invoice + ' - Unknown error'
		print '%s' % e

payment_was_successful.connect(payment_success)
<commit_msg>set registered time by paypal payment time<commit_after># index/signals.py

from datetime import datetime

from ultimate.leagues.models import League, Registrations

from paypal.standard.ipn.signals import payment_was_successful

def payment_success(sender, **kwargs):
	ipn_obj = sender

	print 'PayPal IPN Incoming: ' + ipn_obj.invoice

	try:
		registration = Registrations.objects.get(paypal_invoice_id=ipn_obj.invoice)

		if registration.league.is_waitlist(registration.user):
			registration.waitlist = 1

		registration.paypal_complete = 1
		registration.registered = ipn_obj.payment_date
		registration.save()

		print 'PayPal IPN Success: ' + ipn_obj.invoice
	except Registrations.DoesNotExist:
		print 'PayPal IPN Error: ' + ipn_obj.invoice + ' - Registration does not exist'
	except Exception, e:
		print 'PayPal IPN Error: ' + ipn_obj.invoice + ' - Unknown error'
		print '%s' % e

payment_was_successful.connect(payment_success)

{'fraction_non_alphanumeric': 0.08997289972899729, 'fraction_numerical': 0.002168021680216802, 'mean_word_length': 5.052459016393443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3280725', 'n_tokens_mistral': 648, 'n_tokens_neox': 595, 'n_words': 140}