Skip to content

Commit

Permalink
Set allowed_mime_types on task_description
Browse files Browse the repository at this point in the history
  • Loading branch information
sgeulette committed Apr 20, 2021
1 parent 378fc78 commit 95bee90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -6,6 +6,8 @@ Changelog

- Removed bad step containing empty dependency (persisted now).
[sgeulette]
- Set allowed_mime_types on task_description
[sgeulette]

3.0.5 (2019-09-09)
------------------
Expand Down
6 changes: 5 additions & 1 deletion src/collective/task/behaviors.py
Expand Up @@ -7,7 +7,7 @@
from plone.app.textfield import RichText
from plone.autoform.interfaces import IFormFieldProvider
from plone.dexterity.browser.edit import DefaultEditForm
from plone.directives.form import default_value
from plone.directives.form.value import default_value
from plone.supermodel import model
from plone.supermodel.directives import fieldset
from Products.CMFPlone.utils import base_hasattr
Expand All @@ -31,6 +31,7 @@ def __call__(self, context):
voc = getUtility(IVocabularyFactory, name="plone.principalsource.Groups", context=context)
return voc(context)


AssignedGroupsVocabularyFactory = AssignedGroupsVocabulary()


Expand All @@ -41,6 +42,7 @@ def __call__(self, context):
voc = getUtility(IVocabularyFactory, name="plone.principalsource.Users", context=context)
return voc(context)


EnquirerVocabularyFactory = EnquirerVocabulary()


Expand Down Expand Up @@ -86,6 +88,7 @@ class ITask(model.Schema):
title=_(u"Task description"),
required=False,
description=_(u"What is to do and/or what is done"),
allowed_mime_types=(u"text/html",),
)

assigned_group = LocalRoleMasterSelectField(
Expand Down Expand Up @@ -180,4 +183,5 @@ def validate(self, value):
if value not in [mb.getUserName() for mb in users]:
raise Invalid(_(u"The assigned user is not in the selected assigned group !"))


validator.WidgetValidatorDiscriminators(AssignedUserValidator, field=ITask['assigned_user'])

0 comments on commit 95bee90

Please sign in to comment.