validator.py 411B

123456789101112
  1. from marshmallow.validate import OneOf
  2. from tracim_backend.app_models.contents import CONTENT_TYPES
  3. # TODO - G.M - 2018-08-08 - [GlobalVar] Refactor Global var
  4. # of tracim_backend, Be careful all_content_types_validator is a global_var !
  5. all_content_types_validator = OneOf(choices=[])
  6. def update_validators():
  7. all_content_types_validator.choices = CONTENT_TYPES.endpoint_allowed_types_slug() # nopep8