Untitled
unknown
plain_text
2 years ago
2.9 kB
3
Indexable
forms.py - 2174 class PayApplicationFeeForm(forms.Form): program = forms.CharField() def __init__(self, *args, **kwargs): request = kwargs.pop('request', None) pg_code = kwargs.pop('pg_code', None) super(PayApplicationFeeForm, self).__init__(*args, **kwargs) if pg_code: program = Program.objects.get(program_code=pg_code) self.fields['program'].initial = program.program_name views.py 1273 class ApplicationWizardTemplate(SessionWizardView): template_name = 'application_wizard.html' form_list = [PersonalDetailsForm, EducationDetailsForm, EmploymentDetails, UndertakingForm, PayApplicationFeeForm] condition_dict = {"3":competency_cloud_computing} file_storage = FileSystemStorage(location='/path/to/your/media/folder/') # @applicant_status_permission([settings.APP_STATUS[12][0],settings.APP_STATUS[18][0]]) def get_context_data(self, form, **kwargs): context = super(ApplicationWizardTemplate, self).get_context_data(form=form, **kwargs) pg = self.kwargs.get('pg_code') pg = Program.objects.get(program_code=pg) if self.steps.current == '4': print('STEP-------------4:-', self.steps.current, self.request.user.email) # query = StudentCandidateApplication.objects.get(login_email=self.request.user.email) # print('query',query) # # context['pg_type'] = query.program.program_type != 'certification' # context['ap_id'] = query.application_id() # context['ap_name'] = query.full_name # context['ap_program'] = query.program.program_name # is_pg_inactive = check_inactive_program_flag(query,'active_for_applicaton_flag') # context['is_pg_inactive'] = is_pg_inactive # pay_fee = reverse_lazy('registrationForm:payment-redirect') # context['pay_fee'] = pay_fee # context['disable'] = '' # context['pay_now']=Program.objects.filter(pk =query.program.pk,).exists() # if is_pg_inactive: # context['pay_fee'] = '#' # context['disable'] = 'disabled' # try: # fee_amount, is_paytm = ELOA.objects.get( # Q(fee_amount__gte = 0.01)|Q(fee_amount__isnull=False), # employee_email=query.login_email.email, # exception_type='1', # program=query.program).fee_amount, None # except ELOA.DoesNotExist : # pfa = PROGRAM_FEES_ADMISSION.objects.get( # program=query.program,latest_fee_amount_flag=True, # fee_type='2') # fee_amount, is_paytm = pfa.fee_amount, pfa.is_paytm_enable # context['ap_fee_amount'] = fee_amount # context['is_paytm'] = is_paytm context['pg_name'] = pg.program_name return context
Editor is loading...
Leave a Comment