Skip to content

Commit

Permalink
fix: add str fallback to certain member attributes to handle local pa…
Browse files Browse the repository at this point in the history
…th values returning from API.
  • Loading branch information
waza-ari committed Jan 6, 2024
1 parent 698cf77 commit a70b89b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ here so we can track them and remove when fixed on EV side

- The API does not offer a simple way to ensure that a custom field is set to a certain value for member. You have to either create (POST) a member_custom_field if the member has no relation to a certain custom field yet, or modify an existing one (PATCH) if there is such a relation. Before modifying a value you therefore have to know if such a relation exists or not.
- When deleting a custom field, the relation between the member and a custom field still stays intact, just with `customField` set to `None`. The tests therefore manually delete member custom field associations before deleting the actual custom field definition to not pollute the test tenant.
- Apparently "path" doesn't mean, that is always will be a HTTP URL. In some cases it has been reported that the path is a local file path, following the `<member_number>_<firstname>_<lastname>/<random_number>_<member_number>-SEPA-Mandat_,,,` syntax. My assumption is that those paths have been used before the introduction of S3 storage on EV side. As I couldn't find any documentation around the naming standard, nor find any information how to actually work with these fields, we're simply adding a string fallback.
10 changes: 5 additions & 5 deletions easyverein/models/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from pydantic import Field, PositiveInt

from ..core.types import AnyHttpURL, Date, DateTime, EasyVereinReference
from .base import EasyVereinBase
from .mixins.required_attributes import required_mixin
from ..core.types import AnyHttpURL, Date, DateTime, EasyVereinReference


class Member(EasyVereinBase):
Expand Down Expand Up @@ -43,9 +43,9 @@ class Member(EasyVereinBase):
"""
Alias for `_chairmanPermissionGroup` field. See [Pydantic Models](../usage.md#pydantic-models) for details.
"""
declarationOfApplication: AnyHttpURL | None = None
declarationOfResignation: AnyHttpURL | None = None
declarationOfConsent: AnyHttpURL | None = None
declarationOfApplication: AnyHttpURL | str | None = None
declarationOfResignation: AnyHttpURL | str | None = None
declarationOfConsent: AnyHttpURL | str | None = None
membershipNumber: str | None = None
contactDetails: ContactDetails | EasyVereinReference | None = None
paymentStartDate: DateTime | None = Field(default=None, alias="_paymentStartDate")
Expand Down Expand Up @@ -84,7 +84,7 @@ class Member(EasyVereinBase):
"""
Alias for `_editableByRelatedMembers` field. See [Pydantic Models](../usage.md#pydantic-models) for details.
"""
sepaMandateFile: AnyHttpURL | None = None
sepaMandateFile: AnyHttpURL | str | None = None
# TODO: exact type is not specified in API docs
integrationDosbSport: list | None = None
customFields: EasyVereinReference | list[MemberCustomField] | None = None
Expand Down

0 comments on commit a70b89b

Please sign in to comment.