-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixups for admin SponsorLogo upload. #9794
Conversation
added resolutions to comments from #9792 (review) |
sponsor_name = slugify(form.name.data) | ||
if request.POST.get("white_logo") not in [None, b""]: | ||
if request.POST.get(image_name) not in [None, b""]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(slight remark, but this is more simply expressed as if request.POST.get(image_name):
, no ?)
fingerprint = secrets.token_urlsafe(6) | ||
filename = f"{sponsor_name}-{slugify(image_name)}-{fingerprint}{extension}" | ||
return storage.store(filename, fp.name) | ||
return "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't return None
be more explicit ? (or an exception)
* ensure prefix is applied for GCSSponsorLogoStorage * lint * sponsor logos: deduplicate upload code, fingerprint uploads * my first walrus * fix coverage
No description provided.