# HG changeset patch # User Julien Cristau # Date 1420639283 -3600 # Node ID c33dcd18e0bb36abfdb8e91654c8bdca5a6f2760 # Parent 52e011d0867532456e576f0bcee13bbe16ce6235# Parent a1364ac56bb973c26d0f1bf2849ed69faad5c505 merge 3.19.7 into 3.20 diff -r 52e011d08675 -r c33dcd18e0bb .hgtags --- a/.hgtags Wed Jan 07 14:07:17 2015 +0100 +++ b/.hgtags Wed Jan 07 15:01:23 2015 +0100 @@ -386,6 +386,9 @@ 934341b848a6874688314d7c154183aca3aed530 cubicweb-version-3.19.6 934341b848a6874688314d7c154183aca3aed530 cubicweb-debian-version-3.19.6-1 934341b848a6874688314d7c154183aca3aed530 cubicweb-centos-version-3.19.6-1 +ac4f5f615597575bec32f8f591260e5a91e53855 cubicweb-version-3.19.7 +ac4f5f615597575bec32f8f591260e5a91e53855 cubicweb-debian-version-3.19.7-1 +ac4f5f615597575bec32f8f591260e5a91e53855 cubicweb-centos-version-3.19.7-1 7e6b7739afe6128589ad51b0318decb767cbae36 cubicweb-version-3.20.0 7e6b7739afe6128589ad51b0318decb767cbae36 cubicweb-debian-version-3.20.0-1 7e6b7739afe6128589ad51b0318decb767cbae36 cubicweb-centos-version-3.20.0-1 diff -r 52e011d08675 -r c33dcd18e0bb __pkginfo__.py diff -r 52e011d08675 -r c33dcd18e0bb cubicweb.spec diff -r 52e011d08675 -r c33dcd18e0bb debian/changelog --- a/debian/changelog Wed Jan 07 14:07:17 2015 +0100 +++ b/debian/changelog Wed Jan 07 15:01:23 2015 +0100 @@ -4,6 +4,12 @@ -- Julien Cristau Tue, 06 Jan 2015 18:11:03 +0100 +cubicweb (3.19.7-1) unstable; urgency=low + + * new upstream release + + -- Julien Cristau Wed, 07 Jan 2015 14:37:59 +0100 + cubicweb (3.19.6-1) unstable; urgency=low * new upstream release diff -r 52e011d08675 -r c33dcd18e0bb debian/control --- a/debian/control Wed Jan 07 14:07:17 2015 +0100 +++ b/debian/control Wed Jan 07 15:01:23 2015 +0100 @@ -131,13 +131,15 @@ fckeditor, python-fyzz, python-imaging, - python-rdflib + python-rdflib, + python-werkzeug, Breaks: cubicweb-inlinedit (<< 1.1.1), Description: web interface library for the CubicWeb framework CubicWeb is a semantic web application framework. . This package provides an adaptative web interface to the CubicWeb server. + It also ships a WSGI interface for CubicWeb instances. Install the cubicweb-twisted package to serve this interface via HTTP. . This package provides the web interface part of the library and diff -r 52e011d08675 -r c33dcd18e0bb debian/cubicweb-web.install.in --- a/debian/cubicweb-web.install.in Wed Jan 07 14:07:17 2015 +0100 +++ b/debian/cubicweb-web.install.in Wed Jan 07 15:01:23 2015 +0100 @@ -1,3 +1,4 @@ usr/lib/PY_VERSION/*-packages/cubicweb/web +usr/lib/PY_VERSION/*-packages/cubicweb/wsgi usr/share/cubicweb/cubes/shared/data usr/share/cubicweb/cubes/shared/wdoc diff -r 52e011d08675 -r c33dcd18e0bb doc/book/en/devrepo/datamodel/definition.rst --- a/doc/book/en/devrepo/datamodel/definition.rst Wed Jan 07 14:07:17 2015 +0100 +++ b/doc/book/en/devrepo/datamodel/definition.rst Wed Jan 07 15:01:23 2015 +0100 @@ -83,7 +83,7 @@ update or delete entities of this type. The following built-in types are available: ``String``, -``Int``, ``Float``, ``Decimal``, ``Boolean``, +``Int``, ``BigInt``, ``Float``, ``Decimal``, ``Boolean``, ``Date``, ``Datetime``, ``Time``, ``Interval``, ``Byte`` and ``Password``. They can only be used as attributes of an other entity type. diff -r 52e011d08675 -r c33dcd18e0bb hooks/security.py --- a/hooks/security.py Wed Jan 07 14:07:17 2015 +0100 +++ b/hooks/security.py Wed Jan 07 15:01:23 2015 +0100 @@ -116,8 +116,9 @@ # save back editedattrs in case the entity is reedited later in the # same transaction, which will lead to cw_edited being # overwritten + action = 'add' if self._cw.added_in_transaction(self.entity.eid) else 'update' CheckEntityPermissionOp.get_instance(self._cw).add_data( - (self.entity.eid, 'update', self.entity.cw_edited) ) + (self.entity.eid, action, self.entity.cw_edited) ) class BeforeDelEntitySecurityHook(SecurityHook): diff -r 52e011d08675 -r c33dcd18e0bb server/sources/native.py --- a/server/sources/native.py Wed Jan 07 14:07:17 2015 +0100 +++ b/server/sources/native.py Wed Jan 07 15:01:23 2015 +0100 @@ -711,10 +711,7 @@ """ cursor = cnx.cnxset.cu if server.DEBUG & server.DBG_SQL: - cnx = cnx.cnxset.cnx - # getattr to get the actual connection if cnx is a CnxLoggingWrapper - # instance - print 'exec', query, args, getattr(cnx, '_cnx', cnx) + print 'exec', query, args, cnx.cnxset.cnx try: # str(query) to avoid error if it's a unicode string cursor.execute(str(query), args) diff -r 52e011d08675 -r c33dcd18e0bb server/test/data/schema.py --- a/server/test/data/schema.py Wed Jan 07 14:07:17 2015 +0100 +++ b/server/test/data/schema.py Wed Jan 07 15:01:23 2015 +0100 @@ -155,7 +155,11 @@ class Old(EntityType): - name = String() + name = String(__permissions__ = { + 'read' : ('managers', 'users', 'guests'), + 'add' : ('managers', 'users', 'guests'), + 'update' : () + }) class connait(RelationType): diff -r 52e011d08675 -r c33dcd18e0bb server/test/unittest_security.py --- a/server/test/unittest_security.py Wed Jan 07 14:07:17 2015 +0100 +++ b/server/test/unittest_security.py Wed Jan 07 15:01:23 2015 +0100 @@ -169,6 +169,15 @@ cnx.execute("INSERT Societe X: X nom 'looogilab'") cnx.execute("SET X travaille S WHERE X nom 'biduuule', S nom 'looogilab'") + def test_insert_immutable_attribute_update(self): + with self.admin_access.repo_cnx() as cnx: + cnx.create_entity('Old', name=u'Babar') + cnx.commit() + # this should be equivalent + o = cnx.create_entity('Old') + o.cw_set(name=u'Celeste') + cnx.commit() + def test_update_rql_permission(self): with self.admin_access.repo_cnx() as cnx: cnx.execute("SET A concerne S WHERE A is Affaire, S is Societe") diff -r 52e011d08675 -r c33dcd18e0bb test/unittest_entity.py --- a/test/unittest_entity.py Wed Jan 07 14:07:17 2015 +0100 +++ b/test/unittest_entity.py Wed Jan 07 15:01:23 2015 +0100 @@ -600,8 +600,8 @@ def test_printable_value_string(self): with self.admin_access.web_request() as req: e = req.create_entity('Card', title=u'rest test', - content=u'du :eid:`1:*ReST*`', - content_format=u'text/rest') + content=u'du :eid:`1:*ReST*`', + content_format=u'text/rest') self.assertEqual(e.printable_value('content'), '

du *ReST*

') e.cw_attr_cache['content'] = 'du html users' @@ -610,8 +610,8 @@ 'du html users') e.cw_attr_cache['content'] = 'du *texte*' e.cw_attr_cache['content_format'] = 'text/plain' - self.assertEqual(e.printable_value('content'), - '

\ndu *texte*

') + self.assertEqual(e.printable_value('content').replace("\n", ""), + '

du *texte*

') e.cw_attr_cache['title'] = 'zou' e.cw_attr_cache['content'] = '''\ a title diff -r 52e011d08675 -r c33dcd18e0bb test/unittest_uilib.py --- a/test/unittest_uilib.py Wed Jan 07 14:07:17 2015 +0100 +++ b/test/unittest_uilib.py Wed Jan 07 15:01:23 2015 +0100 @@ -178,9 +178,9 @@ self.assertMultiLineEqual(uilib.soup2xhtml(incoming, 'ascii'), expected) def test_unknown_namespace(self): - incoming = ''' - - + incoming = '''
XXXXXXX
\ +\ +\
XXXXXXX
''' expected = '''\ \