Skip to content

Commit

Permalink
Normalize dynamic values
Browse files Browse the repository at this point in the history
  • Loading branch information
di committed Mar 18, 2024
1 parent c70ade1 commit 7e73d98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion warehouse/forklift/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,11 @@ def file_upload(request):
# this and store this as a list.
keywords=", ".join(meta.keywords) if meta.keywords else None,
requires_python=str(meta.requires_python) if meta.requires_python else None,
# Since dynamic field values are RFC 822 email headers, which are
# case-insensitive, normalize them to title-case so we don't have
# to store every possible variation, and can use an enum to restrict them
# in the database
dynamic=[x.title() for x in meta.dynamic] if meta.dynamic else None,
**{
k: getattr(meta, k)
for k in {
Expand All @@ -723,7 +728,6 @@ def file_upload(request):
"maintainer_email",
"home_page",
"download_url",
"dynamic",
"provides_extra",
}
},
Expand Down

0 comments on commit 7e73d98

Please sign in to comment.