Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/api/endpoints/annotate/all/post/models/name.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict

Check warning on line 1 in src/api/endpoints/annotate/all/post/models/name.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] src/api/endpoints/annotate/all/post/models/name.py#L1 <100>

Missing docstring in public module
Raw output
./src/api/endpoints/annotate/all/post/models/name.py:1:1: D100 Missing docstring in public module


class AnnotationPostNameInfo(BaseModel):
model_config = ConfigDict(extra="forbid")
new_name: str | None = None
existing_name_id: int | None = None

Expand Down
5 changes: 3 additions & 2 deletions src/api/endpoints/annotate/all/post/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ async def run(self, session: AsyncSession) -> None:
# Add relevant annotation
requester.add_relevant_annotation(self.post_info.suggested_status)

await requester.optionally_add_name_suggestion(self.post_info.name_info)


# If not relevant, do nothing else
if self.post_info.suggested_status == URLType.NOT_RELEVANT:
return
Expand All @@ -44,5 +47,3 @@ async def run(self, session: AsyncSession) -> None:
requester.optionally_add_record_type(self.post_info.record_type)

requester.add_agency_ids(self.post_info.agency_ids)

await requester.optionally_add_name_suggestion(self.post_info.name_info)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from src.api.endpoints.annotate.all.post.models.request import AllAnnotationPostInfo
from src.core.enums import RecordType
from src.db.models.impl.flag.url_validated.enums import URLType
from src.db.models.impl.link.user_name_suggestion.sqlalchemy import LinkUserNameSuggestion
from src.db.models.impl.url.suggestion.agency.user import UserUrlAgencySuggestion
from src.db.models.impl.url.suggestion.location.user.sqlalchemy import UserLocationSuggestion
from src.db.models.impl.url.suggestion.name.sqlalchemy import URLNameSuggestion
Expand Down Expand Up @@ -154,3 +155,7 @@
suggested_names: set[str] = {name_suggestion.suggestion for name_suggestion in name_suggestions}
assert "New Name" in suggested_names

# Confirm 2 link user name suggestions
link_user_name_suggestions: list[LinkUserNameSuggestion] = await adb_client.get_all(LinkUserNameSuggestion)
assert len(link_user_name_suggestions) == 2

Check warning on line 161 in tests/automated/integration/api/annotate/all/test_happy_path.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] tests/automated/integration/api/annotate/all/test_happy_path.py#L161 <391>

blank line at end of file
Raw output
./tests/automated/integration/api/annotate/all/test_happy_path.py:161:1: W391 blank line at end of file