@@ -53,7 +53,9 @@ def location(self):
53
53
if not self .use_auth_basic :
54
54
return location
55
55
assert self .auth_basic_username and self .auth_basic_password
56
- replacement = "{}:{}@" .format (self .auth_basic_username , self .auth_basic_password )
56
+ replacement = "{}:{}@" .format (
57
+ self .auth_basic_username , self .auth_basic_password
58
+ )
57
59
location = location .replace ("://" , "://" + replacement )
58
60
return location
59
61
@@ -198,16 +200,16 @@ class MagentoCRUDAdapter(AbstractComponent):
198
200
_usage = "backend.adapter"
199
201
200
202
def search (self , filters = None ):
201
- """ Search records according to some criterias
202
- and returns a list of ids """
203
+ """Search records according to some criterias
204
+ and returns a list of ids"""
203
205
raise NotImplementedError
204
206
205
207
def read (self , external_id , attributes = None , storeview = None ):
206
208
""" Returns the information of a record """
207
209
raise NotImplementedError
208
210
209
211
def search_read (self , filters = None ):
210
- """ Search records according to some criterias
212
+ """Search records according to some criterias
211
213
and returns their information"""
212
214
raise NotImplementedError
213
215
@@ -225,7 +227,7 @@ def delete(self, external_id):
225
227
226
228
def _call (self , method , arguments = None , http_method = None , storeview = None ):
227
229
try :
228
- magento_api = getattr (self .work , "magento_api" )
230
+ magento_api = getattr (self .work , "magento_api" ) # noqa: B009
229
231
except AttributeError :
230
232
raise AttributeError (
231
233
"You must provide a magento_api attribute with a "
@@ -252,7 +254,7 @@ class GenericAdapter(AbstractComponent):
252
254
253
255
@staticmethod
254
256
def get_searchCriteria (filters ):
255
- """ Craft Magento 2.0 searchCriteria from filters, for example:
257
+ """Craft Magento 2.0 searchCriteria from filters, for example:
256
258
'searchCriteria[filter_groups][0][filters][0][field]': 'website_id',
257
259
'searchCriteria[filter_groups][0][filters][0][value]': '1,2',
258
260
'searchCriteria[filter_groups][0][filters][0][condition_type]': 'in',
@@ -301,7 +303,7 @@ def get_searchCriteria(filters):
301
303
return res if res else {"searchCriteria" : "" }
302
304
303
305
def search (self , filters = None ):
304
- """ Search records according to some criterias
306
+ """Search records according to some criterias
305
307
and returns a list of unique identifiers
306
308
307
309
In the case of Magento 2.x: query the resource to return the key field
@@ -339,7 +341,7 @@ def escape(term):
339
341
return term
340
342
341
343
def read (self , external_id , attributes = None , storeview = None ):
342
- """ Returns the information of a record
344
+ """Returns the information of a record
343
345
344
346
:rtype: dict
345
347
"""
@@ -371,7 +373,7 @@ def read(self, external_id, attributes=None, storeview=None):
371
373
return next (record for record in res if record ["id" ] == external_id )
372
374
373
375
def search_read (self , filters = None ):
374
- """ Search records according to some criterias
376
+ """Search records according to some criterias
375
377
and returns their information"""
376
378
if self .collection .version == "1.7" :
377
379
return self ._call ("%s.list" % self ._magento_model , [filters ])
@@ -410,7 +412,8 @@ def admin_url(self, external_id):
410
412
if not url :
411
413
raise ValueError ("No admin URL configured on the backend." )
412
414
if hasattr (self .model , "_get_admin_path" ):
413
- admin_path = getattr (self .model , "_get_admin_path" )(backend , external_id )
415
+ admin_func = getattr (self .model , "_get_admin_path" ) # noqa: B009
416
+ admin_path = admin_func (backend , external_id )
414
417
else :
415
418
key = "_admin2_path" if backend .version == "2.0" else "_admin_path"
416
419
admin_path = getattr (self , key )
0 commit comments