Repair Candidate admin add view
This commit is contained in:
parent
e8d84329b2
commit
8ccfeb394f
1 changed files with 5 additions and 4 deletions
|
|
@ -124,10 +124,11 @@ class CandidateAdminForm(forms.ModelForm):
|
|||
fields = '__all__'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
try:
|
||||
kwargs['initial'] = {'interview': kwargs['instance'].interview}
|
||||
except Interview.DoesNotExist:
|
||||
pass
|
||||
if kwargs.get('instance'):
|
||||
try:
|
||||
kwargs['initial'] = {'interview': kwargs['instance'].interview}
|
||||
except Interview.DoesNotExist:
|
||||
pass
|
||||
return super().__init__(*args, **kwargs)
|
||||
|
||||
def save(self, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue