mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
UPRN-prefixed property folders rename to a single-UPRN filename 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
787f7731b2
commit
e533316771
1 changed files with 4 additions and 1 deletions
|
|
@ -97,12 +97,15 @@ class SharepointRenamerOrchestrator:
|
|||
def _process_row(
|
||||
self, roots: list[str], uprn: str, address: str, postcode: str
|
||||
) -> None:
|
||||
# Batch folders name properties "{uprn}_{address}"; filenames must not
|
||||
# repeat the UPRN, so the folder lookup and the canonical name diverge.
|
||||
display_address = address.removeprefix(f"{uprn}_")
|
||||
for root in roots:
|
||||
folder_path = (
|
||||
f"{root}/{address}, {postcode}"
|
||||
f"/{SharepointSubfolders.ASSESSMENT.value}/{ASSESSMENT_SUBFOLDER}"
|
||||
)
|
||||
if self._process_folder(folder_path, uprn, address, postcode):
|
||||
if self._process_folder(folder_path, uprn, display_address, postcode):
|
||||
return
|
||||
logger.warning(
|
||||
f"Missing folder for UPRN {uprn} in any root: {address}, {postcode}"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue