Commit 4de476e3 authored by Antoine Millet's avatar Antoine Millet
Browse files

Fixed to_get/to_check/to_show/to_display calculation.

parent 0771ad96
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -225,6 +225,11 @@ class CCServer(object):
        to_show += show

        # Calculate the tags to get/check/show:
        if to_get is not None:
            to_get -= set((self.RESERVED_TAGS))
        if to_check is not None:
            to_check -= set((self.RESERVED_TAGS))
        
        deny = set()

        for tag in copy(to_show):
@@ -238,6 +243,15 @@ class CCServer(object):
                elif tag in to_show:
                    to_show.remove(tag)

        if to_show is None:
            to_display = None
        else:
            to_display = set(to_show) | to_get

        if to_show is not None:
            to_show = set(to_show)
            to_show -= set((self.RESERVED_TAGS))

        objects = OrderedSet(self.objects.all(to_get, to_check))
        if ast is not None:
            objects, _ = ast.eval(objects, objects)
@@ -251,6 +265,6 @@ class CCServer(object):
        objects_dicts = []
        
        for obj in objects:
            objects_dicts.append(obj.to_dict(to_show, deny=deny))
            objects_dicts.append(obj.to_dict(to_display, deny=deny))

        return objects_dicts
+2 −1
Original line number Diff line number Diff line
@@ -718,6 +718,7 @@ class TqlParser(object):
        elif separator[1] == '%':
            tree = TqlAstSorter(left, right)
        elif separator[1] == '$':
            self._to_show.append(right)
            tree = left
        else:
            raise TqlParsingError('Bad separator %r' % separator[1])
@@ -737,7 +738,7 @@ class TqlParser(object):

        # Add the tag name to the list of tags to get:
        self._to_check.add(word[1])
        self._to_show.append(left[1])
        self._to_show.append(word[1])

        return TqlAstTag(word[1])