Add user permission checks for series editing and enhance author display method
This commit is contained in:
+1
-11
@@ -387,7 +387,7 @@ class SeriesImageBase(models.Model):
|
||||
super().save(*args, **kwargs) # Call the "real" save() method.
|
||||
|
||||
|
||||
class SeriesBase(models.Model):
|
||||
class SeriesBase(models.Model, AuthorMixin):
|
||||
info = models.TextField(
|
||||
blank=True,
|
||||
help_text="Description of stack, for admin organisation, will not be visible when taking",
|
||||
@@ -444,16 +444,6 @@ class SeriesBase(models.Model):
|
||||
|
||||
return False
|
||||
|
||||
def get_author_objects(self):
|
||||
"""Returns a list of authors"""
|
||||
if self.author:
|
||||
return self.author.all()
|
||||
else:
|
||||
return ["None"]
|
||||
|
||||
def get_author_display(self):
|
||||
return ", ".join([i.username for i in self.get_author_objects()])
|
||||
|
||||
def get_examination(self):
|
||||
"""Returns a comma seperated text list of regions"""
|
||||
return str(self.examination)
|
||||
|
||||
Reference in New Issue
Block a user