feat: investigate file authenticity#7331
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7331 +/- ##
==========================================
- Coverage 88.98% 88.87% -0.12%
==========================================
Files 291 291
Lines 40717 41071 +354
==========================================
+ Hits 36233 36500 +267
- Misses 4484 4571 +87 ☔ View full report in Codecov by Sentry. |
jennifer-richards
left a comment
There was a problem hiding this comment.
A couple minor comments to take or leave
| # looking for files with less than 8 characters in the name is not useful | ||
| # Requiring this will help protect against the secretariat unintentionally | ||
| # matching every draft. | ||
| if len(name_fragment) < 8: |
There was a problem hiding this comment.
If you put min_length=8 on the CharField, it'll validate for you and (I think) catch it client-side with HTML validation
| # matching every draft. | ||
| if len(name_fragment) < 8: | ||
| raise ValidationError("Please enter at least 8 characters") | ||
| if any([c in name_fragment for c in disallowed_characters]): |
There was a problem hiding this comment.
Completely trivial gains here, but if you leave out the [] inside the any(), then this will use generators instead of a list. That'll let the any() short-circuit if it hits a True value.
| settings.INTERNET_DRAFT_ARCHIVE_DIR = str(new_archive_dir) | ||
| donated_personal_copy_dir = archive_tmp_dir / "donated-personal-copy" | ||
| donated_personal_copy_dir.mkdir() | ||
| meeting_dir = Path(settings.AGENDA_PATH) / "666" |
No description provided.