Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLark86 committed Oct 28, 2024
1 parent 0df0f35 commit 7690ee8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
16 changes: 4 additions & 12 deletions content_api/items/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,9 @@ class ContentAPIItem(ResourceModel, ModelWithVersions):
uri: Annotated[fields.Keyword | None, validators.validate_iunique_value_async("items", "uri")] = None
usageterms: str | None = None
version: str | None = None
versioncreated: datetime = Field(
default_factory=datetime.now
)
firstcreated: datetime = Field(
default_factory=datetime.now
)
firstpublished: datetime = Field(
default_factory=datetime.now
)
versioncreated: datetime = Field(default_factory=datetime.now)
firstcreated: datetime = Field(default_factory=datetime.now)
firstpublished: datetime = Field(default_factory=datetime.now)
embargoed: datetime | None = None
evolvedfrom: fields.Keyword | None = None
nextversion: fields.Keyword | None = None
Expand All @@ -178,9 +172,7 @@ class ContentAPIItem(ResourceModel, ModelWithVersions):
agenda_id: fields.Keyword | None = None
agenda_href: fields.Keyword | None = None

refs: list[ContentReference] = Field(
default_factory=list
)
refs: list[ContentReference] = Field(default_factory=list)
expiry: datetime = Field(default_factory=datetime.now)

@field_validator("version", mode="before")
Expand Down
12 changes: 8 additions & 4 deletions tests/core/resource_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,23 @@ def test_elastic_mapping(self):
"_updated": {"type": "date"},
"_etag": {"type": "text"},
"first_name": {
"type": "text", "fields": {"keyword": {"type": "keyword"}},
"type": "text",
"fields": {"keyword": {"type": "keyword"}},
"analyzer": "html_field_analyzer",
},
"last_name": {
"type": "text", "fields": {"keyword": {"type": "keyword"}},
"type": "text",
"fields": {"keyword": {"type": "keyword"}},
"analyzer": "html_field_analyzer",
},
"email": {
"type": "text", "fields": {"keyword": {"type": "keyword"}},
"type": "text",
"fields": {"keyword": {"type": "keyword"}},
"analyzer": "html_field_analyzer",
},
"name": {
"type": "text", "fields": {"keyword": {"type": "keyword"}},
"type": "text",
"fields": {"keyword": {"type": "keyword"}},
"analyzer": "html_field_analyzer",
},
"username": {"type": "text"},
Expand Down

0 comments on commit 7690ee8

Please sign in to comment.