Prevent exception when adding new candidate
This commit is contained in:
parent
261ed1e99b
commit
e3a9ef7443
2 changed files with 4 additions and 0 deletions
|
|
@ -114,6 +114,8 @@ class CandidateAdmin(admin.ModelAdmin):
|
|||
convocation_mail.boolean = True
|
||||
|
||||
def candidate_actions(self, obj):
|
||||
if not obj.pk:
|
||||
return ''
|
||||
return format_html(
|
||||
'<a class="button" href="{}">Confirmation de réception FE + EDE</a> '
|
||||
'<a class="button" href="{}">Validation enseignants EDE</a> '
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ class CandidateTests(TestCase):
|
|||
street = 'de Neuchâtel 99',
|
||||
)
|
||||
self.client.login(username='me', password='mepassword')
|
||||
response = self.client.get(url)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
response = self.client.post(url, post_data)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue