Skip to content

Commit

Permalink
Port vangheem's commit - Be able to override factory for types
Browse files Browse the repository at this point in the history
  • Loading branch information
gitcarbs committed Oct 30, 2018
1 parent 9c3dfd9 commit adc04bd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
3.2.17-1
-------------------
- Be able to override factory for types
[vangheem]
- Require pycryptodome instead of pycrypto
[vangheem]


3.2.16-1
-------------------

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.16-1
3.2.17-1
4 changes: 2 additions & 2 deletions guillotina/api/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ async def __call__(self):
# Create object
try:
obj = await create_content_in_container(
self.context, type_, new_id, id=new_id, creators=(user,),
contributors=(user,))
self.context, type_, new_id,
creators=(user,), contributors=(user,))
except ValueError as e:
return ErrorResponse(
'CreatingObject',
Expand Down
8 changes: 5 additions & 3 deletions guillotina/configure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ def load_contenttype(_context, contenttype):
if 'schema' in conf:
classImplements(klass, conf['schema'])

from guillotina.content import ResourceFactory
Factory = resolve_dotted_name(
conf.get('factory', 'guillotina.content.ResourceFactory')
)

factory = ResourceFactory(
factory = Factory(
klass,
title='',
description='',
Expand Down Expand Up @@ -616,4 +618,4 @@ def scan(path):


def clear():
_registered_configurations[:] = []
_registered_configurations[:] = []
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ chardet==3.0.4
jsonschema==2.6.0
multidict==3.2.0
pycparser==2.18
pycrypto==2.6.1
pycryptodome==3.6.6
PyJWT==1.6.0
python-dateutil==2.6.1
PyYAML==3.12
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
'aiohttp>=2.3.6,<2.4.0',
'jsonschema',
'python-dateutil',
'pycrypto',
'pycryptodome',
'setuptools',
'ujson',
'zope.interface',
Expand Down

0 comments on commit adc04bd

Please sign in to comment.