mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Large commit of HR application, users can submit, admin can accept/reject
This commit is contained in:
16
hr/forms.py
16
hr/forms.py
@@ -37,4 +37,20 @@ def CreateApplicationForm(user):
|
||||
return self.cleaned_data
|
||||
return ApplicationForm
|
||||
|
||||
def CreateApplicationStatusForm(admin):
|
||||
|
||||
if admin:
|
||||
form_choices = APPLICATION_STATUS_CHOICES
|
||||
else:
|
||||
form_choices = APPLICATION_STATUS_CHOICES_USER
|
||||
|
||||
class ApplicationStatusForm(forms.Form):
|
||||
""" Application Status Change Form """
|
||||
|
||||
application = forms.IntegerField(required=True, widget=forms.HiddenInput)
|
||||
new_status = forms.ChoiceField(label = u'New Status', choices = form_choices)
|
||||
|
||||
class Meta:
|
||||
exclude = ('application')
|
||||
|
||||
return ApplicationStatusForm
|
||||
|
||||
Reference in New Issue
Block a user