Commit eec5170e authored by Elouan Martinet's avatar Elouan Martinet
Browse files

merge 3.31 into default

Pipeline #66601 passed with stage
in 11 minutes and 20 seconds
......@@ -673,16 +673,19 @@ e731c31eaed06ac0a781db4d9a36d8b3732a4852 debian/3.27.2-1
f2e07e9cc36753c9bb21030a05a6d715aa33a289 3.27.4
7e69862f2332df296950afa7d4943471dec01986 3.27.5
7b332e2e0287182c6e9283b7debf4eb7233d3bad 3.27.6
c517d3f941b484cd0c81b81891a7d50d0ed6f10b 3.27.7
695832965852f2a8d6c767dab0f74903c962feb8 3.28.0rc1
2c0ecdfda9c46f95ef514efa0c9c06c96c98b4bd 3.28.0
4b2725c4066a0015afa66267dea3bd392235194d 3.28.1
152838b95709e95297996583a7f1a20262453970 3.28.2
0b6a5ea3950bcb3bc50b38e7d7288e3b59a7cb1a 3.28.3
f9d1400d311fb123aa5ce69a3d36742550441646 3.28.4
a20956da474443f84cee8f41e8d7e88683a4c124 3.28.5
08e8654133c1f0c44d96da36e054347c22d30c9d 3.29.0
54ddcc997e1cfb7f8701e226fb88128737898c0b 3.29.1
7ddad2aa6426aa73c09cc8232ecbe0f11bfd5d9c 3.29.2
f5768f140cde2e522be7c14ec180e87865890743 3.29.3
2052a708e92d598936cc84b8eb1030281283d2fc 3.29.4
bedf6cb540ca4dd0b099ce3c6b00e1202d48168a 3.30.0
8b2537520e184d8df7723e98d37f34a8fe7128df 3.31.0
f0007241c4773160b6c2b93a0b56a9617a74389c 3.31.1
from __future__ import absolute_import
import webtest
from cubicweb.wsgi import handler
......
from __future__ import absolute_import
import markdown
import logging
......
from __future__ import print_function
try:
(rtype,) = __args__
except ValueError:
......
from __future__ import print_function
from base64 import b64decode, b64encode
try:
......
......@@ -225,6 +225,9 @@ class HTMLHeadTC(CubicWebTC):
head.add_js(base_url + "bob1.js")
head.add_js("http://ext.com/bob2.js")
head.add_js("http://ext.com/bob3.js")
head.write_front(
'<script type="text/javascript">console.log("FIRST SCRIPT ADDED HERE")</script>\n'
)
head.add_css(base_url + "bob4.css")
head.add_css(base_url + "bob5.css")
head.add_css(base_url + "bob6.css", "print")
......@@ -233,6 +236,7 @@ class HTMLHeadTC(CubicWebTC):
head.add_ie_css(base_url + "bob9.css", "print", "[if lt IE 7]")
result = head.getvalue()
expected = """<head>
<script type="text/javascript">console.log("FIRST SCRIPT ADDED HERE")</script>
<link rel="stylesheet" type="text/css" media="all" href="http://test.fr/data/bob4.css"/>
<link rel="stylesheet" type="text/css" media="all" href="http://test.fr/data/bob5.css"/>
<link rel="stylesheet" type="text/css" media="print" href="http://test.fr/data/bob6.css"/>
......
......@@ -17,8 +17,6 @@
# with CubicWeb. If not, see <https://www.gnu.org/licenses/>.
"""Some utilities for CubicWeb server/clients."""
from __future__ import division
import base64
import decimal
import datetime
......@@ -27,6 +25,7 @@ import re
import json
from operator import itemgetter
from inspect import getfullargspec as getargspec
from functools import wraps
from itertools import repeat
from uuid import uuid4
from warnings import warn
......@@ -199,6 +198,22 @@ class RepeatList(object):
self._size -= 1
def handle_writing_constraints(method):
@wraps(method)
def wrapper(self, value):
if self.tracewrites:
from traceback import format_stack
stack = format_stack(None)[:-1]
escaped_stack = xml_escape(json_dumps("\n".join(stack)))
escaped_html = xml_escape(value).replace("\n", "<br/>\n")
tpl = '<span onclick="alert(%s)">%s</span>'
value = tpl % (escaped_stack, escaped_html)
return method(self, value)
return wrapper
class UStringIO(list):
"""a file wrapper which automatically encode unicode string to an encoding
specifed in the constructor
......@@ -213,17 +228,14 @@ class UStringIO(list):
__nonzero__ = __bool__
@handle_writing_constraints
def write(self, value):
if self.tracewrites:
from traceback import format_stack
stack = format_stack(None)[:-1]
escaped_stack = xml_escape(json_dumps("\n".join(stack)))
escaped_html = xml_escape(value).replace("\n", "<br/>\n")
tpl = '<span onclick="alert(%s)">%s</span>'
value = tpl % (escaped_stack, escaped_html)
self.append(value)
@handle_writing_constraints
def write_front(self, value):
self.insert(0, value)
def getvalue(self):
return "".join(self)
......
......@@ -16,6 +16,12 @@ cubicweb (3.30.0-1) unstable; urgency=medium
-- Simon Chabot <simon.chabot@logilab.fr> Tue, 16 Mar 2021 16:28:48 +0100
cubicweb (3.29.4-1) unstable; urgency=medium
* New bugfix release
-- Aurélien Lubert <aurelien.lubert@logilab.fr> Thu, 24 Jun 2021 15:25:42 +0200
cubicweb (3.29.3-1) unstable; urgency=medium
* New upstream release
......@@ -40,6 +46,12 @@ cubicweb (3.29.0-1) unstable; urgency=medium
-- Laurent Peuch <cortex@worlddomination.be> Tue, 08 Dec 2020 14:51:17 +0200
cubicweb (3.28.5-1) unstable; urgency=medium
* New upstream release
-- Nicolas Chauvat <nicolas.chauvat@logilab.fr> Tue, 22 Jun 2021 22:08:18 +0200
cubicweb (3.28.4-1) unstable; urgency=medium
* New upstream release
......@@ -70,6 +82,12 @@ cubicweb (3.28.0-1) unstable; urgency=medium
-- Chabot Simon <schabot@logilab.fr> Wed, 24 Jun 2020 10:17:13 +0200
cubicweb (3.27.7-1) unstable; urgency=medium
* New upstream release
-- Nicolas Chauvat <nicolas.chauvat@logilab.fr> Tue, 22 Jun 2021 20:50:12 +0200
cubicweb (3.27.6-1) unstable; urgency=medium
* New upstream release
......
......@@ -2,10 +2,9 @@ Source: cubicweb
Section: web
Priority: optional
Maintainer: Logilab S.A. <contact@logilab.fr>
Uploaders: Sylvain Thenault <sylvain.thenault@logilab.fr>,
David Douard <david.douard@logilab.fr>,
Uploaders: Nicolas Chauvat <nicolas.chauvat@logilab.fr>,
Build-Depends:
debhelper (>= 9.20160709),
debhelper (>= 12.1.1),
dh-python,
python3-all,
python3-setuptools,
......@@ -30,7 +29,7 @@ Build-Depends:
sphinx-common,
Standards-Version: 4.3.0
Homepage: https://www.cubicweb.org
X-Python3-Version: >= 3.6
X-Python3-Version: >= 3.7
Package: python3-cubicweb
......
......@@ -271,7 +271,7 @@ How to import LDAP users in |cubicweb| ?
print 'USAGE: python ldap2system.py <database>'
sys.exit(1)
if raw_input('update %s db ? [y/n]: ' % database).strip().lower().startswith('y'):
if input('update %s db ? [y/n]: ' % database).strip().lower().startswith('y'):
cnx = get_connection(user=getlogin(), database=database)
cursor = cnx.cursor()
......
......@@ -478,8 +478,8 @@ simplify greatly complex security definition and upgrade.
class my_relation(RelationDefinition):
__permissions__ = {'read': ('managers', 'users'),
'add': ('managers', RRQLExpression('U has_update_permission S')),
'delete': ('managers', RRQLExpression('U has_update_permission S'))
}
'delete': ('managers', RRQLExpression('U has_update_permission S')),
}
In the above example, user will be allowed to add/delete `my_relation` if he has
the `update` permission on the subject of the relation.
......
......@@ -123,19 +123,19 @@ attribute and relation. Here is the code to add to :file:`schema.py`:
'add': ('managers',),
'update': ('managers', 'owners',),
'delete': ('managers', 'owners'),
}
}
AUTH_ONLY_PERMISSIONS = {
'read': ('managers', 'users'),
'add': ('managers',),
'update': ('managers', 'owners',),
'delete': ('managers', 'owners'),
}
}
CLASSIFIERS_PERMISSIONS = {
'read': ('managers', 'users', 'guests'),
'add': ('managers',),
'update': ('managers', 'owners',),
'delete': ('managers', 'owners'),
}
}
from cubicweb_folder.schema import Folder
from cubicweb_file.schema import File
......
......@@ -76,8 +76,8 @@ setup(
"filelock",
"rdflib",
"rdflib-jsonld",
"pyramid >= 1.5.0,<2",
"waitress >= 1.4.0,<2",
"pyramid >= 1.5.0, < 2.0.0",
"waitress >= 1.4.0, < 2.0.0",
"wsgicors >= 0.3",
"pyramid_multiauth",
"repoze.lru",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment