Commit e326fb2a authored by Élodie Thiéblin's avatar Élodie Thiéblin
Browse files

[doc] Fix bugs in code examples

parent 89acc8d3d462
...@@ -174,7 +174,7 @@ What's important in there: ...@@ -174,7 +174,7 @@ What's important in there:
Step 2: security propagation in hooks Step 2: security propagation in hooks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To fullfill the requirements, we have to implement:: To fullfill the requirements defined earlier, we have to implement:
Also, unless explicity specified, visibility of an image should be the same as Also, unless explicity specified, visibility of an image should be the same as
its parent folder, as well as visibility of a comment should be the same as the its parent folder, as well as visibility of a comment should be the same as the
...@@ -348,7 +348,7 @@ model, in :file:`test/test_sytweb.py`: ...@@ -348,7 +348,7 @@ model, in :file:`test/test_sytweb.py`:
visibility=u'restricted') visibility=u'restricted')
photo1 = cnx.create_entity('File', photo1 = cnx.create_entity('File',
data_name=u'photo1.jpg', data_name=u'photo1.jpg',
data=Binary('xxx'), data=Binary(b'xxx'),
filed_under=folder) filed_under=folder)
cnx.commit() cnx.commit()
...@@ -359,7 +359,7 @@ model, in :file:`test/test_sytweb.py`: ...@@ -359,7 +359,7 @@ model, in :file:`test/test_sytweb.py`:
# unless explicitly specified # unless explicitly specified
photo2 = cnx.create_entity('File', photo2 = cnx.create_entity('File',
data_name=u'photo2.jpg', data_name=u'photo2.jpg',
data=Binary('xxx'), data=Binary(b'xxx'),
visibility=u'public', visibility=u'public',
filed_under=folder) filed_under=folder)
......
...@@ -31,7 +31,7 @@ in :file:`cubicweb_sytweb/hooks.py` : ...@@ -31,7 +31,7 @@ in :file:`cubicweb_sytweb/hooks.py` :
bfssdir = join(self.repo.config.appdatahome, 'bfss') bfssdir = join(self.repo.config.appdatahome, 'bfss')
if not exists(bfssdir): if not exists(bfssdir):
makedirs(bfssdir) makedirs(bfssdir)
print 'created', bfssdir print('created', bfssdir)
storage = storages.BytesFileSystemStorage(bfssdir) storage = storages.BytesFileSystemStorage(bfssdir)
storages.set_attribute_storage(self.repo, 'File', 'data', storage) storages.set_attribute_storage(self.repo, 'File', 'data', storage)
......
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