def METHOD_NAME(self, context):
    if self.request.user.is_authenticated:
        # Check for unread messages in users channels
        new_forum_messages = False
        user = self.request.user
        one_week_ago = timezone.now() - timezone.timedelta(days=7)
        # All channels belonging to users group
        group_channels = (
            Channel.objects.filter(group__in=user.groups.all())
            .exclude(is_class=True)
            .order_by("-pk")
        )
        # Ordinary channels the user is member of
        common_channels = (
            Channel.objects.filter(group=None)
            .filter(members=self.request.user)
            .exclude(is_feed=True)
            .exclude(is_class=True)
        )
        # Feeds
        feeds = Channel.objects.filter(is_feed=True)
        all_users_channels = chain(feeds, group_channels, common_channels)
        for channel in all_users_channels:
            if new_forum_messages:
                break
            for thread in Thread.objects.filter(channel=channel):
                if Message.objects.filter(
                    thread=thread, created__gte=one_week_ago
                ).exclude(read_by_user=self.request.user):
                    new_forum_messages = True
                    break
        context["new_forum_messages"] = new_forum_messages
        if FysmatClass.objects.filter(user=self.request.user).exists():
            # If multiple classes, use first entry
            fysmat_class = FysmatClass.objects.filter(
                user=self.request.user
            ).first()
            class_channel, created = Channel.objects.get_or_create(
                group=fysmat_class, is_class=True, name=fysmat_class.name
            )
            latest_class = Thread.objects.filter(channel=class_channel).order_by(
                "-pk"
            )[:4]
            context["fysmat_class"] = fysmat_class
            context["latest_class"] = latest_class
        else:
            messages.add_message(
                self.request,
                messages.INFO,
                "Brukeren din er ikke tilknyttet noen kullgruppe. Ta kontakt med WebKom for å få det fikset.",
            )
        latest_feed = Thread.objects.filter(channel__is_feed=True).order_by("-pk")[
            :4
        ]
        context["latest_feed"] = latest_feed