Remove hard dependency on pinax teams

This commit is contained in:
Timothy Hobbs
2020-12-02 01:21:56 +01:00
parent b9855ec83f
commit 2e867cba87
8 changed files with 18 additions and 9 deletions

View File

@ -25,8 +25,6 @@ from django.utils.safestring import mark_safe
from markdown import markdown
from markdown.extensions import Extension
import pinax.teams.models
import uuid
@ -1359,7 +1357,7 @@ class KBItem(models.Model):
)
team = models.ForeignKey(
pinax.teams.models.Team,
helpdesk_settings.HELPDESK_TEAMS_MODEL,
on_delete=models.CASCADE,
verbose_name=_('Team'),
blank=True,
@ -1382,6 +1380,9 @@ class KBItem(models.Model):
self.last_updated = timezone.now()
return super(KBItem, self).save(*args, **kwargs)
def get_team(self):
return helpdesk_settings.HELPDESK_KBITEM_TEAM_GETTER(self)
def _score(self):
""" Return a score out of 10 or Unrated if no votes """
if self.votes > 0: