Exemple #1
0
def identification_uploaded_callback(sender, **kwargs):
    if 'user' in kwargs:
        for application in Application.objects.filter(applicant_profile__user=kwargs.get('user')):
            if application.id_check_status == 'awaiting_update':
                application.id_check_status = 'updated'
                application.customer_status = determine_customer_status(application)
                application.processing_status = determine_processing_status(application)
                application.save()
Exemple #2
0
def return_submitted_callback(sender, **kwargs):
    if 'ret' in kwargs:
        ret = kwargs.get('ret')
        try:
            previous_application = Application.objects.get(licence=ret.licence)
            application = Application.objects.get(previous_application=previous_application)
            if application.returns_check_status == 'awaiting_returns':
                if not Return.objects.filter(licence=ret.licence).exclude(status='submitted').\
                        exclude(status='approved').exists():
                    application.returns_check_status = 'completed'
                    application.customer_status = determine_customer_status(application)
                    application.processing_status = determine_processing_status(application)
                    application.save()
        except Application.DoesNotExist:
            pass
Exemple #3
0
def identification_uploaded_callback(sender, **kwargs):
    if 'request' in kwargs:
        request = kwargs.get('request')
        is_app_awaiting_id_check = False
        for application in Application.objects.filter(applicant_profile__user=request.user):
            if application.id_check_status == 'awaiting_update':
                application.id_check_status = 'updated'
                application.customer_status = determine_customer_status(application)
                application.processing_status = determine_processing_status(application)
                application.save()

                is_app_awaiting_id_check = True

        if is_app_awaiting_id_check:
            messages.success(request, 'Thank you for providing your photographic identification. Any application(s) '
                             'currently awaiting this identification will now proceed with processing.')
Exemple #4
0
def return_submitted_callback(sender, **kwargs):
    if 'ret' in kwargs:
        ret = kwargs.get('ret')
        try:
            previous_application = Application.objects.get(licence=ret.licence)
            application = Application.objects.get(
                previous_application=previous_application)
            if application.returns_check_status == 'awaiting_returns':
                if not Return.objects.filter(licence=ret.licence).exclude(status='submitted').\
                        exclude(status='approved').exists():
                    application.returns_check_status = 'completed'
                    application.customer_status = determine_customer_status(
                        application)
                    application.processing_status = determine_processing_status(
                        application)
                    application.save()
        except Application.DoesNotExist:
            pass
Exemple #5
0
def identification_uploaded_callback(sender, **kwargs):
    if 'request' in kwargs:
        request = kwargs.get('request')
        is_app_awaiting_id_check = False
        for application in Application.objects.filter(
                applicant_profile__user=request.user):
            if application.id_check_status == 'awaiting_update':
                application.id_check_status = 'updated'
                application.customer_status = determine_customer_status(
                    application)
                application.processing_status = determine_processing_status(
                    application)
                application.save()

                is_app_awaiting_id_check = True

        if is_app_awaiting_id_check:
            messages.success(
                request,
                'Thank you for providing your photographic identification. Any application(s) '
                'currently awaiting this identification will now proceed with processing.'
            )