invoice-x / factur-x-ng

Python lib for Factur-X, the e-invoicing standard for France and Germany
Other
34 stars 8 forks source link

Edit if condition to check for embedded resources #20

Closed duskybomb closed 6 years ago

duskybomb commented 6 years ago

We can merge this. It was my initial commit to branch issue/16

m3nu commented 6 years ago

Here is the issue with this PR:

  1. check for \Names.
  2. If \Names exists, check for \EmbeddedFiles.

By doing this you can take advantage of the fact that Python checks AND conditions from left to right.

duskybomb commented 6 years ago

You mean I should use nested if?

m3nu commented 6 years ago

Using an and would be clearest. But it's fine. If it fixes your issue, let's merge it. I didn't realize this is only a very minor check before reading the XML.

I also don't like too many nots. This is generally a sign of bad layout.