Jump to >

reviewboard.admin.middleware

class InitReviewBoardMiddleware(*args, **kwargs)[source]

Bases: object

Handle the initialization of Review Board.

__init__(*args, **kwargs)[source]

Initialize the middleware.

process_request(request)[source]

Ensure that Review Board initialization code has run.

class LoadSettingsMiddleware[source]

Bases: object

Middleware that loads the settings on each request.

process_request(request)[source]

Ensure that the latest siteconfig is loaded.

class CheckUpdatesRequiredMiddleware[source]

Bases: object

Middleware that checks if manual updates need to be done.

If updates are required, all attempts to access a URL will be redirected to the updates page (or an appropriate error response for API calls).

ALLOWED_PATHS = (u'/static/', u'/jsi18n/')[source]
process_view(request, view_func, view_args, view_kwargs)[source]

Check whether updates are required.

This returns the appropriate response if any updates are required, otherwise it allows the normal code to run.

class ExtraExceptionInfoMiddleware[source]

Bases: object

Add extra debugging information to exception e-mails.

If an exception occurs, the META field will be updated to contain the username and e-mail address of the user who triggered the error (if any), and the Local Site name (if any).

process_exception(request, exception)[source]

Process an exception.

Exceptions from views are handled by sending the admin users an e-mail with the traceback. This adds additional information to the META dictionary before that happens.