Skip to content

Commit 75617a8

Browse files
authored
Fix country_subdivision field (pretix#25)
* fixes PostalTradeAddress - corrects order of elements - makes country_id required - downgrades country_subdivision to profile BASIC * black formatting
1 parent 78b360d commit 75617a8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

drafthorse/models/party.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ class PostalTradeAddress(Element):
99
line_two = StringField(NS_RAM, "LineTwo", required=False, profile=BASIC)
1010
line_three = StringField(NS_RAM, "LineThree", required=False, profile=BASIC)
1111
city_name = StringField(NS_RAM, "CityName", required=False, profile=BASIC)
12+
country_id = StringField(NS_RAM, "CountryID", required=True, profile=BASIC)
1213
country_subdivision = StringField(
13-
NS_RAM, "CountrySubDivisionName", required=False, profile=EXTENDED
14+
NS_RAM, "CountrySubDivisionName", required=False, profile=BASIC
1415
)
15-
country_id = StringField(NS_RAM, "CountryID", required=False, profile=BASIC)
1616

1717
class Meta:
1818
namespace = NS_RAM

tests/test_mininal.py

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ def test_readme_construction_example():
3333
doc.trade.settlement.currency_code = "EUR"
3434
doc.trade.settlement.payment_means.type_code = "ZZZ"
3535

36+
doc.trade.agreement.seller.address.country_id = "DE"
37+
doc.trade.agreement.seller.address.country_subdivision = "Bayern"
38+
3639
li = LineItem()
3740
li.document.line_id = "1"
3841
li.product.name = "Rainbow"

0 commit comments

Comments
 (0)