habitat.views.habitat

Functions for the core habitat design document.

Contains a validation function that applies to every document.

Functions

must_be_admin(user[, msg]) Raise UnauthorizedError if the user is not an admin
validate(new, old, userctx, secobj) Core habitat validation function.
version Mock out external modules that might annoy documentation build systems.

Exceptions

ForbiddenError Mock out external modules that might annoy documentation build systems.
habitat.views.habitat.validate(new, old, userctx, secobj)[source]

Core habitat validation function.

  • Prevent deletion by anyone except administrators.
  • Prevent documents without a type.
  • Prevent documents whose type is invalid.
  • Prevent changing document type.