.
This commit is contained in:
+9
-3
@@ -407,11 +407,17 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
|
|||||||
# return f"{self.pk}: {self.title}"
|
# return f"{self.pk}: {self.title}"
|
||||||
return format_html("<a href='{}'>{}</a>", self.get_absolute_url(), str(self))
|
return format_html("<a href='{}'>{}</a>", self.get_absolute_url(), str(self))
|
||||||
|
|
||||||
def get_cimar_case(self):
|
def get_cimar_case(self, raise_404_if_not_found=False):
|
||||||
return get_object_or_404(CimarCase, uuid=self.cimar_uuid)
|
if raise_404_if_not_found:
|
||||||
|
return get_object_or_404(CimarCase, uuid=self.cimar_uuid)
|
||||||
|
|
||||||
|
try:
|
||||||
|
CimarCase.objects.get(uuid=self.cimar_uuid)
|
||||||
|
except CimarCase.DoesNotExist:
|
||||||
|
return None
|
||||||
|
|
||||||
def get_cimar_case_details(self):
|
def get_cimar_case_details(self):
|
||||||
cimar_case = self.get_cimar_case()
|
cimar_case = self.get_cimar_case(raise_404_if_not_found=True)
|
||||||
return cimar_case.study_details
|
return cimar_case.study_details
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user