@@ -73,27 +73,28 @@ def before_dataset_index(self, pkg_dict: dict[str, Any]) -> dict[str, Any]:
7373
7474 def _is_all_api_format (self , pkg_dict : dict [str , Any ]) -> bool :
7575 """Check if the dataset contains a resource in a format recognized as an API.
76- This involves determining if the format of the resource is CSV and if this resource exists in the datastore
77- or matches a format inside a predefined list.
76+ This involves determining if the format of the resource is CSV and if this
77+ resource exists in the datastore or matches a format inside a predefined list.
7878 """
79- for resource in tk .get_action ("package_show" )({"ignore_auth" : True },
80- {"id" : pkg_dict ["id" ]}).get (
81- "resources" , []):
79+ for resource in tk .get_action ("package_show" )(
80+ {"ignore_auth" : True },
81+ {"id" : pkg_dict ["id" ]}
82+ ).get ("resources" , []):
8283 if resource ["format" ].upper () == "CSV" and resource ["datastore_active" ]:
8384 return True
8485
8586 if [
8687 res_format
8788 for res_format in pkg_dict ["res_format" ]
8889 if res_format
89- in [
90- "WMS" ,
91- "WFS" ,
92- "API" ,
93- "ARCGIS GEOSERVICES REST API" ,
94- "ESRI REST" ,
95- "GEOJSON" ,
96- ]
90+ in [
91+ "WMS" ,
92+ "WFS" ,
93+ "API" ,
94+ "ARCGIS GEOSERVICES REST API" ,
95+ "ESRI REST" ,
96+ "GEOJSON" ,
97+ ]
9798 ]:
9899 return True
99100 return False
@@ -110,10 +111,11 @@ def get_categories(self):
110111 # IAuthenticator
111112
112113 def login (self ) -> Optional [Response ]:
113- session .regenerate_id () # type: ignore
114+ session .modified = True
114115
115116 def logout (self ) -> Optional [Response ]:
116- session .regenerate_id () # type: ignore
117+ session .modified = True
118+
117119
118120 # ISignal
119121
@@ -170,15 +172,15 @@ class DatavicODPThemeAuth(p.SingletonPlugin):
170172
171173 We are chaining auth functions from activity and overriding its templates
172174 at the same time. The former requires us to put our plugin after the
173- activty , while the latter will work only if we put our plugin before the
175+ activity , while the latter will work only if we put our plugin before the
174176 activity. The only way to solve this puzzle is to split the logic between
175177 two sub-plugins.
176178
177179 """
178180 pass
179181
180182
181- class DatavicXLoaderPlugin (xloaderPlugin ):
183+ class DatavicXLoaderPlugin (xloaderPlugin , p . SingletonPlugin ):
182184 p .implements (p .IPackageController , inherit = True )
183185
184186 # IPackageController
0 commit comments