# HG changeset patch # User Elodie Thieblin # Date 1584527405 -3600 # Node ID 327b11ee0914afb761c11ffb01104434003b2593 # Parent 89acc8d3d4629a6ec3dc2e98ee7794c8c899344f [doc] Fix bugs in code examples diff -r 89acc8d3d462 -r 327b11ee0914 doc/tutorials/advanced/part02_security.rst --- a/doc/tutorials/advanced/part02_security.rst Wed Mar 18 11:29:30 2020 +0100 +++ b/doc/tutorials/advanced/part02_security.rst Wed Mar 18 11:30:05 2020 +0100 @@ -174,7 +174,7 @@ 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 its parent folder, as well as visibility of a comment should be the same as the @@ -348,7 +348,7 @@ visibility=u'restricted') photo1 = cnx.create_entity('File', data_name=u'photo1.jpg', - data=Binary('xxx'), + data=Binary(b'xxx'), filed_under=folder) cnx.commit() @@ -359,7 +359,7 @@ # unless explicitly specified photo2 = cnx.create_entity('File', data_name=u'photo2.jpg', - data=Binary('xxx'), + data=Binary(b'xxx'), visibility=u'public', filed_under=folder) diff -r 89acc8d3d462 -r 327b11ee0914 doc/tutorials/advanced/part03_bfss.rst --- a/doc/tutorials/advanced/part03_bfss.rst Wed Mar 18 11:29:30 2020 +0100 +++ b/doc/tutorials/advanced/part03_bfss.rst Wed Mar 18 11:30:05 2020 +0100 @@ -31,7 +31,7 @@ bfssdir = join(self.repo.config.appdatahome, 'bfss') if not exists(bfssdir): makedirs(bfssdir) - print 'created', bfssdir + print('created', bfssdir) storage = storages.BytesFileSystemStorage(bfssdir) storages.set_attribute_storage(self.repo, 'File', 'data', storage)