@@ -68,27 +68,28 @@ def before_dataset_index(self, pkg_dict: dict[str, Any]) -> dict[str, Any]:
6868
6969 def _is_all_api_format (self , pkg_dict : dict [str , Any ]) -> bool :
7070 """Check if the dataset contains a resource in a format recognized as an API.
71- This involves determining if the format of the resource is CSV and if this resource exists in the datastore
72- or matches a format inside a predefined list.
71+ This involves determining if the format of the resource is CSV and if this
72+ resource exists in the datastore or matches a format inside a predefined list.
7373 """
74- for resource in tk .get_action ("package_show" )({"ignore_auth" : True },
75- {"id" : pkg_dict ["id" ]}).get (
76- "resources" , []):
74+ for resource in tk .get_action ("package_show" )(
75+ {"ignore_auth" : True },
76+ {"id" : pkg_dict ["id" ]}
77+ ).get ("resources" , []):
7778 if resource ["format" ].upper () == "CSV" and resource ["datastore_active" ]:
7879 return True
7980
8081 if [
8182 res_format
8283 for res_format in pkg_dict ["res_format" ]
8384 if res_format
84- in [
85- "WMS" ,
86- "WFS" ,
87- "API" ,
88- "ARCGIS GEOSERVICES REST API" ,
89- "ESRI REST" ,
90- "GEOJSON" ,
91- ]
85+ in [
86+ "WMS" ,
87+ "WFS" ,
88+ "API" ,
89+ "ARCGIS GEOSERVICES REST API" ,
90+ "ESRI REST" ,
91+ "GEOJSON" ,
92+ ]
9293 ]:
9394 return True
9495 return False
@@ -105,26 +106,27 @@ def get_categories(self):
105106 # IAuthenticator
106107
107108 def login (self ) -> Optional [Response ]:
108- session .regenerate_id () # type: ignore
109+ session .modified = True
109110
110111 def logout (self ) -> Optional [Response ]:
111- session .regenerate_id () # type: ignore
112+ session .modified = True
113+
112114
113115@tk .blanket .auth_functions (auth_functions )
114116class DatavicODPThemeAuth (p .SingletonPlugin ):
115117 """Register auth function inside separate extension.
116118
117119 We are chaining auth functions from activity and overriding its templates
118120 at the same time. The former requires us to put our plugin after the
119- activty , while the latter will work only if we put our plugin before the
121+ activity , while the latter will work only if we put our plugin before the
120122 activity. The only way to solve this puzzle is to split the logic between
121123 two sub-plugins.
122124
123125 """
124126 pass
125127
126128
127- class DatavicXLoaderPlugin (xloaderPlugin ):
129+ class DatavicXLoaderPlugin (xloaderPlugin , p . SingletonPlugin ):
128130 p .implements (p .IPackageController , inherit = True )
129131
130132 # IPackageController
0 commit comments