Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, *args, **kwargs):
super(InvoiceTemplate, self).__init__(*args, **kwargs)
# Merge template-specific options with defaults
self.options = OPTIONS_DEFAULT.copy()
for lang in self.options['languages']:
assert len(lang) == 2, 'lang code must have 2 letters'
if 'options' in self:
self.options.update(self['options'])
# Set issuer, if it doesn't exist.
if 'issuer' not in self.keys():
self['issuer'] = self['keywords'][0]