Preserve site model input and fix XLSX output path#2900
Preserve site model input and fix XLSX output path#2900kadirawkz wants to merge 1 commit intosherlock-project:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to (1) preserve SiteInformation’s username_unclaimed value from the site model input instead of overwriting it, and (2) ensure XLSX exports respect --folderoutput like the CSV export already does.
Changes:
- Stop overwriting
SiteInformation.username_unclaimedduring initialization (intended to preserve the input value). - Build the XLSX output path using
--folderoutput(and create the folder if needed) before writing the Excel file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sherlock_project/sites.py |
Changes how username_unclaimed is set on SiteInformation. |
sherlock_project/sherlock.py |
Writes XLSX output to the correct folder when --folderoutput is used. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self.username_claimed = username_claimed | ||
| self.username_unclaimed = secrets.token_urlsafe(32) | ||
| self.username_unclaimed = username_unclaimed | ||
| self.information = information |
There was a problem hiding this comment.
SiteInformation.username_unclaimed is now taken from the username_unclaimed parameter, but SitesInformation currently constructs SiteInformation(...) without passing any unclaimed username from the loaded site data. As a result, every site will use the constructor default, and because that default is computed at function-definition time (username_unclaimed=secrets.token_urlsafe(10)), all instances will share the same value. To actually preserve the site model input, pass through site_data[site_name].get("username_unclaimed") (or similar) when constructing SiteInformation, and change the constructor default to something like None so a fresh token can be generated per-instance when missing.
Summary:
Files changed:
Details: