1. zikzakmedia
  2. python-envialia

Commits

Raimon Esteve (Zikzakmedia)  committed bbd437c

Retur false API if don't have Envialia connection

  • Participants
  • Parent commits 3b56e0e
  • Branches default

Comments (0)

Files changed (1)

File envialia/picking.py

View file
 
         :return: List delivery references
         """
+        if not self.session:
+            return False
         if not date:
             today = datetime.date.today()
             date = today.strftime('%Y/%m/%d')
 
         :return: List of dictionaries of matching records
         """
+        if not self.session:
+            return False
         delivery = {}
         envxml = ENVXML()
         data = envxml.envialia_xml_picking_info(self.session, reference, data)
         :param data: Dictionary of values
         :return: Integer ID of new record
         """
+        if not self.session:
+            return False
         delivery = {}
         envxml = ENVXML()
         data = envxml.envialia_xml_picking_create(self.session, data)
         :param data: Dictionary of values
         :return: True/False
         """
+        if not self.session:
+            return False
         envxml = ENVXML()
         data = envxml.envialia_xml_picking_delete(self.session, reference, data)
         data = self.connect(data)
         :param data: Dictionary of values
         :return: String
         """
+        if not self.session:
+            return False
         envxml = ENVXML()
         data = envxml.envialia_xml_picking_state(self.session, reference, data)
         data = self.connect(data)
         :param data: Dictionary of values
         :return: String
         """
+        if not self.session:
+            return False
         envxml = ENVXML()
         data = envxml.envialia_xml_picking_label(self.session, reference, data)
         data = self.connect(data)