Verified Commit 83f38e61 authored by Sli's avatar Sli
Browse files

Forum Form optimisation

parent 443616a7
Pipeline #1483 passed with stage
in 11 minutes and 59 seconds
...@@ -31,6 +31,7 @@ from django.utils import timezone ...@@ -31,6 +31,7 @@ from django.utils import timezone
from django.utils.functional import cached_property from django.utils.functional import cached_property
from datetime import datetime from datetime import datetime
from itertools import chain
import pytz import pytz
from core.models import User, Group from core.models import User, Group
...@@ -144,10 +145,7 @@ class Forum(models.Model): ...@@ -144,10 +145,7 @@ class Forum(models.Model):
return "%s" % (self.name) return "%s" % (self.name)
def get_full_name(self): def get_full_name(self):
name = '' return '/'.join(chain.from_iterable([[parent.name for parent in self.get_parent_list()], [self.name]]))
for parent in self.get_parent_list():
name += parent.name + '/'
return name + self.name
def get_absolute_url(self): def get_absolute_url(self):
return reverse('forum:view_forum', kwargs={'forum_id': self.id}) return reverse('forum:view_forum', kwargs={'forum_id': self.id})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment