|
163 | 163 | "title": "Altri documenti",
|
164 | 164 | "allowed_types": ("File", "Image", "Link"),
|
165 | 165 | },
|
| 166 | + { |
| 167 | + "id": "dichiarazione-insussistenza-cause-di-inconferibilita-e-incompatibilita", # noqa |
| 168 | + "title": "Dichiarazione insussistenza cause di inconferibilità e" |
| 169 | + " incompatibilità", |
| 170 | + "allowed_types": ("File",), |
| 171 | + }, |
| 172 | + { |
| 173 | + "id": "emolumenti-complessivi-percepiti-a-carico-della-finanza-pubblica", # noqa |
| 174 | + "title": "Emolumenti complessivi percepiti a carico della finanza" |
| 175 | + " pubblica", |
| 176 | + "allowed_types": ("File",), |
| 177 | + }, |
166 | 178 | ],
|
167 | 179 | "allowed_types": [],
|
168 | 180 | },
|
@@ -207,16 +219,7 @@ def onModify(context, event):
|
207 | 219 | child.reindexObject(idxs=["parent"])
|
208 | 220 |
|
209 | 221 |
|
210 |
| -def createSubfolders(context, event): |
211 |
| - """ |
212 |
| - Create subfolders structure based on a portal_type mapping |
213 |
| - """ |
214 |
| - if not IDesignPloneContenttypesLayer.providedBy(context.REQUEST): |
215 |
| - return |
216 |
| - |
217 |
| - subfolders_mapping = SUBFOLDERS_MAPPING.get(context.portal_type, []) |
218 |
| - if not subfolders_mapping: |
219 |
| - return |
| 222 | +def createStructure(context, subfolders_mapping): |
220 | 223 |
|
221 | 224 | for mapping in subfolders_mapping.get("content", {}):
|
222 | 225 | if mapping["id"] not in context.keys():
|
@@ -251,3 +254,16 @@ def createSubfolders(context, event):
|
251 | 254 | constraints_context = ISelectableConstrainTypes(context)
|
252 | 255 | constraints_context.setConstrainTypesMode(1)
|
253 | 256 | constraints_context.setLocallyAllowedTypes(allowed_types)
|
| 257 | + |
| 258 | + |
| 259 | +def createSubfolders(context, event): |
| 260 | + """ |
| 261 | + Create subfolders structure based on a portal_type mapping |
| 262 | + """ |
| 263 | + if not IDesignPloneContenttypesLayer.providedBy(context.REQUEST): |
| 264 | + return |
| 265 | + |
| 266 | + subfolders_mapping = SUBFOLDERS_MAPPING.get(context.portal_type, []) |
| 267 | + if not subfolders_mapping: |
| 268 | + return |
| 269 | + createStructure(context, subfolders_mapping) |
0 commit comments