[webconfig] ensure uicache content has correct uid (related to #11298794) 3.22
authorDavid Douard <david.douard@logilab.fr>
Tue, 19 Jul 2016 19:54:59 +0200
branch3.22
changeset 11437 dbe73990172b
parent 11436 dca6ae982ee5
child 11438 828483a88825
[webconfig] ensure uicache content has correct uid (related to #11298794)
web/webconfig.py
--- a/web/webconfig.py	Tue Jul 19 19:50:48 2016 +0200
+++ b/web/webconfig.py	Tue Jul 19 19:54:59 2016 +0200
@@ -355,7 +355,9 @@
                 warn('[3.20] cubicweb.old.css has been renamed back to cubicweb.css',
                      DeprecationWarning)
                 rid = 'cubicweb.css'
-            return self.uiprops.process_resource(join(directory, rdirectory), rid), rid
+            return self.ensure_uid_directory(
+                        self.uiprops.process_resource(
+                             join(directory, rdirectory), rid)), rid
         return join(directory, rdirectory), rid
 
     def locate_all_files(self, rid, rdirectory='wdoc'):
@@ -462,13 +464,14 @@
         if rdir:
             staticdir = join(staticdir, rdir)
             if not isdir(staticdir) and 'w' in mode:
-                os.makedirs(staticdir)
+                self.check_writeable_uid_directory(staticdir)
         return open(join(staticdir, filename), mode)
 
     def static_file_add(self, rpath, data):
         stream = self.static_file_open(rpath)
         stream.write(data)
         stream.close()
+        self.ensure_uid(rpath)
 
     def static_file_del(self, rpath):
         if self.static_file_exists(rpath):