addid checks to import_products action
This commit is contained in:
@@ -125,11 +125,15 @@ class CompanyViewSet(viewsets.ModelViewSet):
|
||||
instance = self.queryset.filter(pk=kwargs['pk']).first()
|
||||
# check if it's a shop
|
||||
if instance.shop is not True:
|
||||
return Response('This company is not s shop')
|
||||
return Response('This company is not a shop')
|
||||
# check what platform
|
||||
platform = instance.platform
|
||||
if platform is None:
|
||||
return Response('This company is not registered with any platforms')
|
||||
# check required credentials
|
||||
|
||||
credentials = instance.credentials
|
||||
if credentials is None or credentials == {}:
|
||||
return Response('This company has no registered credentials')
|
||||
# execute import
|
||||
|
||||
return Response()
|
||||
|
||||
Reference in New Issue
Block a user