Private kb categories

This commit is contained in:
Timothy Hobbs
2020-01-27 17:37:59 +01:00
parent 0395f26d6c
commit ecbb91b861
9 changed files with 91 additions and 9 deletions

View File

@ -25,6 +25,8 @@ from django.utils.safestring import mark_safe
from markdown import markdown
from markdown.extensions import Extension
import pinax.teams.models
import uuid
@ -1234,6 +1236,11 @@ class KBCategory(models.Model):
verbose_name=_('Default queue when creating a ticket after viewing this category.'),
)
public = models.BooleanField(
default=True,
verbose_name=_("Is KBCategory publicly visible?")
)
def __str__(self):
return '%s' % self.title
@ -1297,6 +1304,14 @@ class KBItem(models.Model):
blank=True,
)
team = models.ForeignKey(
pinax.teams.models.Team,
on_delete=models.CASCADE,
verbose_name=_('Team'),
blank=True,
null=True,
)
def save(self, *args, **kwargs):
if not self.last_updated:
self.last_updated = timezone.now()