@@ -244,7 +244,7 @@ def check_attachment_widget(self):
244244 continue
245245 for field in layer .fields ():
246246 ws = field .editorWidgetSetup ()
247-
247+
248248 if ws and ws .type () == "ExternalResource" :
249249 cfg = ws .config ()
250250 field_name = field .name ()
@@ -257,18 +257,24 @@ def check_attachment_widget(self):
257257
258258 # Check for absolute paths
259259 if not (is_root_active or is_storage_active ):
260- if cfg .get ("RelativeStorage" ) == QgsFileWidget .Absolute : # Absolute= 0, RelativeProject= 1, RelativeDefaultPath= 2
260+ if (
261+ cfg .get ("RelativeStorage" ) == QgsFileWidget .Absolute
262+ ): # Absolute= 0, RelativeProject= 1, RelativeDefaultPath= 2
261263 self .issues .append (SingleLayerWarning (lid , Warning .ATTACHMENT_ABSOLUTE_PATH , field_name ))
262264
263265 # Check Data Defined Overrides
264266 if is_root_active :
265- prop_type = root_path_prop .get ("type" ) # types are more reliable than keys which can be empty - QGIS decides based on type value
267+ prop_type = root_path_prop .get (
268+ "type"
269+ ) # types are more reliable than keys which can be empty - QGIS decides based on type value
266270 if prop_type == 3 : # ExpressionBasedProperty
267271 expression = root_path_prop .get ("expression" , "" ).strip ()
268272 is_field_ref = expression .startswith ('"' ) and expression .endswith ('"' )
269-
273+
270274 if not (PROJECT_VARS .search (expression ) or is_field_ref ):
271- self .issues .append (SingleLayerWarning (lid , Warning .ATTACHMENT_WRONG_EXPRESSION , field_name ))
275+ self .issues .append (
276+ SingleLayerWarning (lid , Warning .ATTACHMENT_WRONG_EXPRESSION , field_name )
277+ )
272278 elif prop_type == 2 : # FieldBasedProperty
273279 pass
274280 else : # 1 = StaticProperty or 0 = InvalidProperty
0 commit comments