Skip to content

Commit

Permalink
personal: Remove field slug from Group
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Feb 9, 2025
1 parent 59d0e0b commit d775eb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions mpicms/personal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class Meta:

@register_snippet
class Group(index.Indexed, models.Model):
slug = models.CharField(_("slug"), max_length=254)
name = models.CharField(_("name"), max_length=254, blank=True)
priority = models.PositiveSmallIntegerField(
_("priority"), blank=True, default=0, validators=[MaxValueValidator(99)],
Expand All @@ -86,11 +85,10 @@ class Group(index.Indexed, models.Model):

search_fields = [
index.SearchField('name', partial_match=True),
index.SearchField('slug'),
]

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

class Meta: # noqa
verbose_name = 'Group'
Expand Down
2 changes: 1 addition & 1 deletion mpicms/personal/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class GroupAdmin(ModelAdmin):
model = Group
menu_label = _('Groups')
menu_icon = 'group'
search_fields = ['name', 'slug']
search_fields = ['name']


class PositionAdmin(ModelAdmin):
Expand Down

0 comments on commit d775eb6

Please sign in to comment.