Skip to content

Commit

Permalink
add help text and blank string to self
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoamaral committed Oct 30, 2023
1 parent a017a62 commit bb80403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/gregory/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Categories(models.Model):
category_description = models.TextField(blank=True, null=True)
category_name = models.CharField(blank=True, null=True,max_length=200)
category_slug = models.SlugField(blank=True, null=True, unique=True) # new field with unique=True
category_terms = ArrayField(models.CharField(blank=False, null=False, max_length=100),default=list,verbose_name='Terms to include in category (comma separated)')
category_terms = ArrayField(models.CharField(blank=False, null=False, max_length=100),default=list,verbose_name='Terms to include in category (comma separated)', help_text="Add terms separated by commas.")

def save(self, *args, **kwargs):
if not self.category_slug:
Expand Down Expand Up @@ -79,7 +79,7 @@ class Sources(models.Model):
description = models.TextField(blank=True, null=True)

def __str__(self):
return self.name
return self.name or ""

class Meta:
managed = True
Expand Down

0 comments on commit bb80403

Please sign in to comment.