merge 3.19.7 into 3.20
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 07 Jan 2015 15:01:23 +0100
changeset 10136 c33dcd18e0bb
parent 10135 52e011d08675 (current diff)
parent 10134 a1364ac56bb9 (diff)
child 10137 15d24437a1d6
merge 3.19.7 into 3.20
.hgtags
__pkginfo__.py
cubicweb.spec
debian/changelog
debian/control
doc/book/en/devrepo/datamodel/definition.rst
server/sources/native.py
server/test/unittest_security.py
test/unittest_entity.py
--- 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
--- 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 <julien.cristau@logilab.fr>  Tue, 06 Jan 2015 18:11:03 +0100
 
+cubicweb (3.19.7-1) unstable; urgency=low
+
+  * new upstream release
+
+ -- Julien Cristau <julien.cristau@logilab.fr>  Wed, 07 Jan 2015 14:37:59 +0100
+
 cubicweb (3.19.6-1) unstable; urgency=low
 
   * new upstream release 
--- 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
--- 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
--- 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.
--- 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):
--- 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)
--- 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):
--- 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")
--- 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'),
                              '<p>du <a class="reference" href="http://testing.fr/cubicweb/cwsource/system">*ReST*</a></p>')
             e.cw_attr_cache['content'] = 'du <em>html</em> <ref rql="CWUser X">users</ref>'
@@ -610,8 +610,8 @@
                               'du <em>html</em> <a href="http://testing.fr/cubicweb/view?rql=CWUser%20X">users</a>')
             e.cw_attr_cache['content'] = 'du *texte*'
             e.cw_attr_cache['content_format'] = 'text/plain'
-            self.assertEqual(e.printable_value('content'),
-                              '<p>\ndu *texte*<br/></p>')
+            self.assertEqual(e.printable_value('content').replace("\n", ""),
+                             '<p>du *texte*<br/></p>')
             e.cw_attr_cache['title'] = 'zou'
             e.cw_attr_cache['content'] = '''\
 a title
--- 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 = '''<table cellspacing="0" cellpadding="0" width="81" border="0" x:str="" style="width: 61pt; border-collapse: collapse">
-<colgroup><col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962"/></colgroup>
-<tbody><tr height="17" style="height: 12.75pt"><td width="81" height="17" style="border-right: #e0dfe3; border-top: #e0dfe3; border-left: #e0dfe3; width: 61pt; border-bottom: #e0dfe3; height: 12.75pt; background-color: transparent"><font size="2">XXXXXXX</font></td></tr></tbody>
+        incoming = '''<table cellspacing="0" cellpadding="0" width="81" border="0" x:str="" style="width: 61pt; border-collapse: collapse">\
+<colgroup><col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962"/></colgroup>\
+<tbody><tr height="17" style="height: 12.75pt"><td width="81" height="17" style="border-right: #e0dfe3; border-top: #e0dfe3; border-left: #e0dfe3; width: 61pt; border-bottom: #e0dfe3; height: 12.75pt; background-color: transparent"><font size="2">XXXXXXX</font></td></tr></tbody>\
 </table>'''
         expected = '''<table cellspacing="0" cellpadding="0" width="81" border="0">\
 <colgroup><col width="81"/></colgroup>\