Exemple #1
0
    def get(self, request, *args, **kwargs):
        utils.remove_temp_applications_for_user(request.user)

        previous_application = get_object_or_404(Application, licence=args[0])

        # check if there is already a renewal or amendment, otherwise create one
        try:
            application = Application.objects.get(
                previous_application=previous_application)
            if application.customer_status == 'under_review':
                messages.warning(
                    request,
                    'An amendment for this licence has already been lodged and is awaiting review.'
                )
                return redirect('wl_dashboard:home')
        except Application.DoesNotExist:
            application = utils.clone_application_with_status_reset(
                previous_application, is_licence_amendment=True)
            application.processing_status = 'licence_amendment'
            application.is_licence_amendment = True
            application.save()

        utils.set_session_application(request.session, application)

        return redirect('wl_applications:enter_details')
Exemple #2
0
    def get(self, request, *args, **kwargs):
        utils.remove_temp_applications_for_user(request.user)

        try:
            utils.set_session_application(request.session, Application.objects.get(id=args[0]))
        except:
            messages.error(self.request, 'Unable to find application')
            return redirect('wl_dashboard:home')

        return redirect('wl_applications:enter_details')
Exemple #3
0
    def get(self, request, *args, **kwargs):
        utils.remove_temp_applications_for_user(request.user)

        try:
            utils.set_session_application(request.session,
                                          Application.objects.get(id=args[0]))
        except:
            messages.error(self.request, 'Unable to find application')
            return redirect('wl_dashboard:home')

        return redirect('wl_applications:enter_details')
Exemple #4
0
    def get(self, request, *args, **kwargs):
        utils.remove_temp_applications_for_user(request.user)

        application = Application.objects.create()

        utils.set_session_application(request.session, application)

        if is_customer(request.user):
            application.applicant = request.user
            application.save()

            return redirect('wl_applications:select_licence_type', *args, **kwargs)
        else:
            application.proxy_applicant = request.user
            application.save()
            return redirect('wl_applications:create_select_customer')
Exemple #5
0
    def get(self, request, *args, **kwargs):
        utils.remove_temp_applications_for_user(request.user)

        application = Application.objects.create()

        utils.set_session_application(request.session, application)

        if is_customer(request.user):
            application.applicant = request.user
            application.save()

            return redirect('wl_applications:select_licence_type', *args,
                            **kwargs)
        else:
            application.proxy_applicant = request.user
            application.save()
            return redirect('wl_applications:create_select_customer')
Exemple #6
0
    def get(self, request, *args, **kwargs):
        utils.remove_temp_applications_for_user(request.user)

        previous_application = get_object_or_404(Application, licence=args[0])

        # check if there is already a renewal, otherwise create one
        try:
            application = Application.objects.get(previous_application=previous_application)
            if application.customer_status == 'under_review':
                messages.warning(request, 'A renewal for this licence has already been lodged and is awaiting review.')
                return redirect('wl_dashboard:home')
        except Application.DoesNotExist:
            application = utils.clone_application_with_status_reset(previous_application)
            application.processing_status = 'renewal'
            application.save()

        utils.set_session_application(request.session, application)

        return redirect('wl_applications:enter_details')