Handles the update of the link redirects counter associated with link forums.
164279
def update_forum_redirects_counter(sender, forum, user, request, response, **kwargs):
    
    if forum.is_link and forum.link_redirects:
        forum.link_redirects_count = F('link_redirects_count') + 1
        forum.save()
1164614
def follow_redirections(self, request):
        """"""
        log.debug(LOG_CHECK, "follow all redirections")
        if self.is_redirect():
            # run connection plugins for old connection
            self.aggregate.plugin_manager.run_connection_plugins(self)
        response = None
        for response in self.get_redirects(request):
            newurl = response.url
            log.debug(LOG_CHECK, "Redirected to %r", newurl)
            self.aliases.append(newurl)
            # XXX on redirect errors this is not printed
            self.add_info(_("Redirected to `%(url)s'.") % {'url': newurl})
            # Reset extern and recalculate
            self.extern = None
            self.set_extern(newurl)
            self.urlparts = strformat.url_unicode_split(newurl)
            self.build_url_parts()
            self.url_connection = response
            self.headers = response.headers
            self.url = urlutil.urlunsplit(self.urlparts)
            self.scheme = self.urlparts[0].lower()
            self._add_ssl_info()
            self._add_response_info()
            if self.is_redirect():
                # run connection plugins for old connection
                self.aggregate.plugin_manager.run_connection_plugins(self)
93038
private void updateNavPos(CmsResource res, CmsSitemapChange change) throws CmsException {

        if (change.hasChangedPosition()) {
            applyNavigationChanges(change, res);
        }
    }
110046
public static function redirectToReferrer()
    {
        $referrer = self::getReferrer();
        if ($referrer !== false) {
            self::redirectToUrl($referrer);
        }
        self::redirectToUrl(self::getCurrentUrlWithoutQueryString());
    }
344411
def mark_forums_read(self, forums, user):
        
        if not forums or not user.is_authenticated:
            return

        forums = sorted(forums, key=lambda f: f.level)

        # Update all forum tracks to the current date for the considered forums
        for forum in forums:
            forum_track = ForumReadTrack.objects.get_or_create(forum=forum, user=user)[0]
            forum_track.save()
        # Delete all the unnecessary topic tracks
        TopicReadTrack.objects.filter(topic__forum__in=forums, user=user).delete()
        # Update parent forum tracks
        self._update_parent_forum_tracks(forums[0], user)
517323
private function _updateDocCount()
    {
        $this->_docCount = 0;
        foreach ($this->_segmentInfos as $segInfo) {
            $this->_docCount += $segInfo->count();
        }
    }
1077096
protected function handleUpdates()
    {
        $config = $this->app->make('config');
        if (!$config->get('concrete.maintenance_mode')) {
            try {
                $this->app->handleAutomaticUpdates();
            } catch (MutexBusyException $x) {
                if ($x->getMutexKey() !== Update::MUTEX_KEY) {
                    throw $x;
                }
                $config->set('concrete.maintenance_mode', true);
            }
            catch (MigrationIncompleteException $x) {
                $request = Request::getInstance();
                $requestUri = $request->getUri();
                $rf = $this->app->make(ResponseFactoryInterface::class);
                return $rf->redirect($requestUri, Response::HTTP_FOUND);
            }
        }
    }
107553
def update_user_trackers(sender, topic, user, request, response, **kwargs):
    
    TrackingHandler = get_class('forum_tracking.handler', 'TrackingHandler')  # noqa
    track_handler = TrackingHandler()
    track_handler.mark_topic_read(topic, user)
1250390
def update_state_active(self):
        
        # Update state to active
        self.update_state(self.links[REF_UPDATE_STATE_ACTIVE], {'type' : RUN_ACTIVE})
        # Returned refreshed verion of the handle
        return self.refresh()
1180590
def _process_redirect(self):
        ''''''
        _logger.debug('Handling redirect.')

        if self._redirect_tracker.exceeded():
            raise ProtocolError('Too many redirects.')

        try:
            url = self._redirect_tracker.next_location()

            if not url:
                raise ProtocolError('Redirect location missing.')

            if self._redirect_tracker.is_repeat():
                _logger.debug('Got redirect is repeat.')

                request = self._original_request.copy()
                request.url = url
            else:
                request = self._request_factory(url)

            request.prepare_for_send()
        except ValueError as error:
            raise ProtocolError('Invalid redirect location.') from error

        self._next_request = request

        _logger.debug('Updated next redirect request to {0}.'.format(request))
905285
def count_pingbacks_handler(sender, **kwargs):
    
    entry = kwargs['entry']
    entry.pingback_count = F('pingback_count') + 1
    entry.save(update_fields=['pingback_count'])
97854
private function needsRedirect()
    {
        /** @var int|string $id */
        $id = $this->getRequest()->param('ID');
        /** @var string $action */
        $action = $this->getRequest()->param('Action');
        /** @var array $handlers */
        $handlers = self::$url_handlers;
        if (array_key_exists($action, $handlers) && $handlers[$action] === 'show' && !$news = $this->getNews()) {
            if ($id && is_numeric($id)) {
                /** @var News $redirect */
                $redirect = $this->Newsitems()->byId($id);
                $this->redirect($redirect->Link(), 301);
            } else {
                /** @var Renamed $renamed */
                $renamed = Renamed::get()->filter(array('OldLink' => $id));
                if ($renamed->count() > 0) {
                    $this->redirect($renamed->First()->News()->Link(), 301);
                } else {
                    $this->redirect($this->Link(), 404);
                }
            }
        } elseif ($action === 'latest') {
            /** @var News $item */
            $item = News::get()->filter(array('Live' => true))->first();
            $this->redirect($item->Link(), 302);
        }
    }
121078
protected void updated()
    {
        if (remaining < 0 && remaining > capacity)
        {
            throw new IllegalArgumentException(remaining+" illegal remaining at %s"+toString());
        }
        if (marked < 0 && marked > capacity)
        {
            throw new IllegalArgumentException(marked+" illegal marked at %s"+toString());
        }
    }
454478
protected function updateDependingRedirects(RedirectInterface $newRedirect)
    {
        /** @var $existingRedirectForSourceUriPath Redirect */
        $existingRedirectForSourceUriPath = $this->redirectRepository->findOneBySourceUriPathAndHost($newRedirect->getSourceUriPath(), $newRedirect->getHost(), false);
        if ($existingRedirectForSourceUriPath !== null) {
            $this->removeAndLog($existingRedirectForSourceUriPath, sprintf('Existing redirect for the source URI path "%s" removed.', $newRedirect->getSourceUriPath()));
            $this->routerCachingService->flushCachesForUriPath($existingRedirectForSourceUriPath->getSourceUriPath());
        }

        /** @var $existingRedirectForTargetUriPath Redirect */
        $existingRedirectForTargetUriPath = $this->redirectRepository->findOneBySourceUriPathAndHost($newRedirect->getTargetUriPath(), $newRedirect->getHost(), false);
        if ($existingRedirectForTargetUriPath !== null) {
            $this->removeAndLog($existingRedirectForTargetUriPath, sprintf('Existing redirect for the target URI path "%s" removed.', $newRedirect->getTargetUriPath()));
            $this->routerCachingService->flushCachesForUriPath($existingRedirectForTargetUriPath->getSourceUriPath());
        }

        $obsoleteRedirectInstances = $this->redirectRepository->findByTargetUriPathAndHost($newRedirect->getSourceUriPath(), $newRedirect->getHost());
        /** @var $obsoleteRedirect Redirect */
        foreach ($obsoleteRedirectInstances as $obsoleteRedirect) {
            if ($obsoleteRedirect->getSourceUriPath() === $newRedirect->getTargetUriPath()) {
                $this->redirectRepository->remove($obsoleteRedirect);
            } else {
                $obsoleteRedirect->setTargetUriPath($newRedirect->getTargetUriPath());
                $this->redirectRepository->update($obsoleteRedirect);
            }
        }
    }
1293551
def moveforum_view(self, request, forum_id, direction):
        
        forum = get_object_or_404(Forum, pk=forum_id)

        # Fetch the target
        target, position = None, None
        if direction == 'up':
            target, position = forum.get_previous_sibling(), 'left'
        elif direction == 'down':
            target, position = forum.get_next_sibling(), 'right'

        # Do the move
        try:
            assert target is not None
            forum.move_to(target, position)
        except (InvalidMove, AssertionError):
            pass
        self.message_user(request, _("'{}' forum successfully moved").format(forum.name))
        return HttpResponseRedirect(reverse('admin:forum_forum_changelist'))
758493
def update_count(self):
        
        node_rating_count = self.node.rating_count
        node_rating_count.comment_count = self.node.comment_set.count()
        node_rating_count.save()
772848
public void notifyUpdate( URL resource, int expected, int count )
    {
        synchronized( m_Monitors )
        {
            for( StreamMonitor monitor : m_Monitors )
            {
                monitor.notifyUpdate( resource, expected, count );
            }
        }
    }