Skip to content

Error {"permission": ["Int value should be less than or equal to 2."]} when setting data to a Template #30

@meunomemauricio

Description

@meunomemauricio

Describe the bug

I'm using the SDK to get a Template via the API, fill it customer data and using the Embedded Signing functionality. The code is working just fine with one of our Templates, but we're trying a new one and the SDK is crashing with:

  File ".../document_generation.py", line xx, in get_template
    template.embedded_signing_enabled = True
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/eversign/utils.py", line 56, in __setattr__
    self.set(key, value)
  File "/usr/local/lib/python3.11/site-packages/eversign/utils.py", line 79, in set
    raise error
  File "/usr/local/lib/python3.11/site-packages/eversign/utils.py", line 76, in set
    self.validate()
  File "/usr/local/lib/python3.11/site-packages/eversign/document.py", line 132, in validate
    self._model.validate()
  File "/usr/local/lib/python3.11/site-packages/schematics/models.py", line 257, in validate
    data = self._convert(validate=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/schematics/models.py", line 299, in _convert
    return func(self._schema, self, raw_data=raw_data, oo=True, context=context, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/schematics/validate.py", line 67, in validate
    raise DataError(errors, data)
schematics.exceptions.DataError: {"permission": ["Int value should be less than or equal to 2."]}

I checked the API response and the API is returning 3, when DocumentModel specifies:

    permission = RangedIntType(min_value=0, max_value=2)

Seems to be related to the Prevent Staff members from modifying this template functionality:

https://help.eversign.com/hc/en-us/articles/6664428164253-Template-Settings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions