mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-03 14:18:16 -06:00
Fixes: #17566 - Fix issue Job.get_absolute_url()
to prevent exception being thrown if no object_type is set
This commit is contained in:
parent
6ea0c0c3e9
commit
57e3f4143e
@ -118,6 +118,7 @@ class Job(models.Model):
|
||||
|
||||
def get_absolute_url(self):
|
||||
# TODO: Employ dynamic registration
|
||||
if self.object_type:
|
||||
if self.object_type.model == 'reportmodule':
|
||||
return reverse(f'extras:report_result', kwargs={'job_pk': self.pk})
|
||||
if self.object_type.model == 'scriptmodule':
|
||||
|
Loading…
Reference in New Issue
Block a user