Skip to content

Commit

Permalink
Merge a2ed0a9 into 50336f3
Browse files Browse the repository at this point in the history
  • Loading branch information
balavec committed Oct 24, 2019
2 parents 50336f3 + a2ed0a9 commit c3e0c1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,8 @@ Changelog
5.0.3 (unreleased)
------------------

- Nothing changed yet.
- Fix flake8-plone-hasattr issue, space and unused import.
[balavec]


5.0.2 (2019-10-21)
Expand Down
Expand Up @@ -3,8 +3,8 @@
from {{{package.dottedname}}} import _
from plone import schema
from plone.autoform.interfaces import IFormFieldProvider
from plone.dexterity.interfaces import IDexterityContent
from plone.supermodel import model
from Products.CMFPlone.utils import safe_hasattr
from zope.component import adapter
from zope.interface import Interface
from zope.interface import implementer
Expand All @@ -14,6 +14,7 @@ from zope.interface import provider
class I{{{behavior_name_klass}}}Marker(Interface):
pass


@provider(IFormFieldProvider)
class I{{{behavior_name_klass}}}(model.Schema):
"""
Expand All @@ -34,7 +35,7 @@ class {{{behavior_name_klass}}}(object):

@property
def project(self):
if hasattr(self.context, 'project'):
if safe_hasattr(self.context, 'project'):
return self.context.project
return None

Expand Down

0 comments on commit c3e0c1f

Please sign in to comment.