Ejemplo n.º 1
0
 def _remove_invalid_codes(self):
     if not len(self.codes):
         raise ValueError("Initialize, codes cannot be empty.")
     valid_codes = [code for code in self.codes if Stock.exist_in_db(code)]
     if not len(valid_codes):
         raise ValueError("Fatal Error: No valid codes or empty codes.")
     self.codes = valid_codes
Ejemplo n.º 2
0
 def _remove_invalid_codes(self):
     if not len(self.codes):
         raise ValueError("Fatal error, odes cannot be empty.")
     valid_codes = [code for code in self.codes if Stock.exist_in_db(code)]
     if not len(valid_codes):
         raise ValueError("Fatal error, no valid codes in database.")
     self.codes = valid_codes