Skip to content

Remove assert to fix DivisionByZero error

Latest
Compare
Choose a tag to compare
@mstephens94 mstephens94 released this 27 Apr 21:10
9ea32c0
DivisionByZero: x // 0
  File "errors/utils.py", line 75, in wrapper
    func(*_args, **_kwargs)
  File "zenefits_payroll/signals/handlers/zp_payment_handlers.py", line 48, in generateZPPhysicalCheckPdf
    instance.generatePdf()
  File "zenefits_payroll/models/zp_payment.py", line 227, in generatePdf
    content = Forms(templateUrl, self.getPdfTemplate()).response().content
  File "zenefits_payroll/models/zp_payment.py", line 193, in getPdfTemplate
    "AMOUNT_IN_WORDS": self.amountInWords,
  File "zenefits_payroll/models/zp_payment.py", line 146, in amountInWords
    return ZPPhysicalCheck._amountInWords(self.amount)
  File "zenefits_payroll/models/zp_payment.py", line 136, in _amountInWords
    res = to_words(amount)
  File "zenefits_payroll/models/zp_payment.py", line 134, in to_words
    return num2words(amount).upper()
  File "num2words/__init__.py", line 50, in num2words
    return converter.to_cardinal(number)
  File "num2words/base.py", line 106, in to_cardinal
    val = self.splitnum(value)
  File "num2words/base.py", line 84, in splitnum
    out.append(self.splitnum(mod))
  File "num2words/base.py", line 84, in splitnum
    out.append(self.splitnum(mod))
  File "num2words/base.py", line 84, in splitnum
    out.append(self.splitnum(mod))
  File "num2words/base.py", line 84, in splitnum
    out.append(self.splitnum(mod))
  File "num2words/base.py", line 72, in splitnum
    div, mod = divmod(value, elem)
  File "python2.7/decimal.py", line 1422, in __divmod__
    return (context._raise_error(DivisionByZero, 'x // 0', sign),
  File "python2.7/decimal.py", line 3872, in _raise_error
    raise error(explanation)