mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Forum Form optimisation
This commit is contained in:
parent
443616a762
commit
83f38e617b
@ -31,6 +31,7 @@ from django.utils import timezone
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
from datetime import datetime
|
||||
from itertools import chain
|
||||
import pytz
|
||||
|
||||
from core.models import User, Group
|
||||
@ -144,10 +145,7 @@ class Forum(models.Model):
|
||||
return "%s" % (self.name)
|
||||
|
||||
def get_full_name(self):
|
||||
name = ''
|
||||
for parent in self.get_parent_list():
|
||||
name += parent.name + '/'
|
||||
return name + self.name
|
||||
return '/'.join(chain.from_iterable([[parent.name for parent in self.get_parent_list()], [self.name]]))
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('forum:view_forum', kwargs={'forum_id': self.id})
|
||||
|
Loading…
Reference in New Issue
Block a user