style: format new source implementations
Some checks failed
Mostovik Backend CI/CD / Tests and lint (push) Failing after 4m33s
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Has been skipped
Mostovik Backend CI/CD / Deploy dev (push) Has been skipped
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been skipped
Some checks failed
Mostovik Backend CI/CD / Tests and lint (push) Failing after 4m33s
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Has been skipped
Mostovik Backend CI/CD / Deploy dev (push) Has been skipped
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been skipped
This commit is contained in:
@@ -129,7 +129,8 @@ def _collect_listing(driver, wait, *, page_type: str, url: str) -> dict:
|
||||
wait.until(
|
||||
lambda browser, seen=before: len(
|
||||
browser.find_elements(By.TAG_NAME, card_tag)
|
||||
) > seen
|
||||
)
|
||||
> seen
|
||||
)
|
||||
except TimeoutException as exc:
|
||||
raise FedresursUpstreamError("incomplete_related_page") from exc
|
||||
@@ -163,7 +164,9 @@ def _collect_related_pages(driver, wait, profile: dict) -> None:
|
||||
driver.get(url)
|
||||
_challenge(driver.page_source)
|
||||
wait.until(
|
||||
lambda browser: _wait_public_element(browser, By.TAG_NAME, "sfact-message-card")
|
||||
lambda browser: _wait_public_element(
|
||||
browser, By.TAG_NAME, "sfact-message-card"
|
||||
)
|
||||
)
|
||||
messages.append(
|
||||
parse_related_page_html(
|
||||
|
||||
@@ -268,8 +268,12 @@ def import_integrated_structures(
|
||||
len(event.documents) for event in structure.events
|
||||
),
|
||||
"unique_documents_count": len(document_ids),
|
||||
"first_event_date": min(event_dates) if event_dates else "",
|
||||
"latest_event_date": max(event_dates) if event_dates else "",
|
||||
"first_event_date": min(event_dates)
|
||||
if event_dates
|
||||
else "",
|
||||
"latest_event_date": max(event_dates)
|
||||
if event_dates
|
||||
else "",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -54,10 +54,12 @@ class ParserLoadLog(TimestampMixin, models.Model):
|
||||
)
|
||||
SRO_MEMBERSHIP_CHECK = "sro_membership_check", _("Проверка членства в СРО")
|
||||
INTEGRATED_STRUCTURE_DOCUMENTS = (
|
||||
"integrated_structure_documents", _("Документы интегрированных структур")
|
||||
"integrated_structure_documents",
|
||||
_("Документы интегрированных структур"),
|
||||
)
|
||||
FEDRESURS_COMPANY_PROFILE = (
|
||||
"fedresurs_company_profile", _("Карточки компаний Федресурса")
|
||||
"fedresurs_company_profile",
|
||||
_("Карточки компаний Федресурса"),
|
||||
)
|
||||
|
||||
class Status(models.TextChoices):
|
||||
@@ -1347,7 +1349,9 @@ class IntegratedStructureDocument(models.Model):
|
||||
"""Document metadata scoped to one validated workbook batch."""
|
||||
|
||||
artifact = models.ForeignKey(
|
||||
ParserSourceArtifact, on_delete=models.CASCADE, related_name="integrated_documents"
|
||||
ParserSourceArtifact,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="integrated_documents",
|
||||
)
|
||||
external_id = models.CharField(max_length=64)
|
||||
name = models.CharField(max_length=1024)
|
||||
|
||||
@@ -270,7 +270,10 @@ def parse_sro_membership(
|
||||
time_limit=24 * 3600 + 300,
|
||||
)
|
||||
def parse_fedresurs_company_profiles(
|
||||
self, *, requested_by_id: int | None = None, mode: str = "full",
|
||||
self,
|
||||
*,
|
||||
requested_by_id: int | None = None,
|
||||
mode: str = "full",
|
||||
organization_uids: list[str] | None = None,
|
||||
) -> dict:
|
||||
from apps.parsers.fedresurs_snapshot import refresh_fedresurs_company_profiles
|
||||
|
||||
@@ -1115,8 +1115,11 @@ def _render_xlsx_files(
|
||||
overflow_rows = 0
|
||||
overflow_sheet.append(
|
||||
[
|
||||
str(row.get("uid", "")), key, chunk_number,
|
||||
"utf-8+base64", "b64:" + encoded[offset:offset + EXCEL_SAFE_CELL_CHARACTERS],
|
||||
str(row.get("uid", "")),
|
||||
key,
|
||||
chunk_number,
|
||||
"utf-8+base64",
|
||||
"b64:" + encoded[offset : offset + EXCEL_SAFE_CELL_CHARACTERS],
|
||||
]
|
||||
)
|
||||
overflow_rows += 1
|
||||
|
||||
Reference in New Issue
Block a user