summaryrefslogtreecommitdiff
path: root/app/fieldnotes/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/fieldnotes/models.py')
-rw-r--r--app/fieldnotes/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/fieldnotes/models.py b/app/fieldnotes/models.py
index e3cb527..c14ba80 100644
--- a/app/fieldnotes/models.py
+++ b/app/fieldnotes/models.py
@@ -47,6 +47,9 @@ class FieldNote(models.Model):
def get_absolute_url(self):
return reverse("fieldnotes:detail", kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
+ def get_object_type(self):
+ return 'fieldnote'
+
@property
def region(self):
return self.location.lux_region
@@ -94,8 +97,7 @@ class FieldNote(models.Model):
if not self.id:
self.pub_date = timezone.now()
self.date_last_updated = timezone.now()
- if self.note_type == 1:
- self.featured_image = extract_main_image(self.body_markdown)
+ self.featured_image = extract_main_image(self.body_markdown)
super(FieldNote, self).save()