Skip to content

Commit

Permalink
Make published attribute be NOW() by default, fix translations
Browse files Browse the repository at this point in the history
  • Loading branch information
alanbato committed Apr 13, 2021
1 parent e2681ca commit 380accc
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 55 deletions.
106 changes: 53 additions & 53 deletions warehouse/locale/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ msgstr ""
#: warehouse/templates/manage/account/webauthn-provision.html:53
#: warehouse/templates/manage/account/webauthn-provision.html:74
#: warehouse/templates/manage/release.html:119
#: warehouse/templates/manage/release.html:175
#: warehouse/templates/manage/releases.html:140
#: warehouse/templates/manage/releases.html:173
#: warehouse/templates/packaging/detail.html:314
#: warehouse/templates/manage/release.html:200
#: warehouse/templates/manage/releases.html:169
#: warehouse/templates/manage/releases.html:207
#: warehouse/templates/packaging/detail.html:324
#: warehouse/templates/pages/classifiers.html:25
#: warehouse/templates/pages/help.html:20
#: warehouse/templates/pages/help.html:204
Expand Down Expand Up @@ -2068,7 +2068,7 @@ msgstr ""

#: warehouse/templates/manage/account.html:568
#: warehouse/templates/manage/release.html:58
#: warehouse/templates/packaging/detail.html:346
#: warehouse/templates/packaging/detail.html:356
msgid "None"
msgstr ""

Expand Down Expand Up @@ -2182,8 +2182,8 @@ msgstr ""

#: warehouse/templates/manage/account.html:656
#: warehouse/templates/manage/account.html:671
#: warehouse/templates/manage/history.html:69
#: warehouse/templates/manage/history.html:76
#: warehouse/templates/manage/history.html:74
#: warehouse/templates/manage/history.html:81
msgid "Token name:"
msgstr ""

Expand Down Expand Up @@ -2230,21 +2230,21 @@ msgid "Recent account activity"
msgstr ""

#: warehouse/templates/manage/account.html:694
#: warehouse/templates/manage/history.html:88
#: warehouse/templates/manage/history.html:93
msgid "Event"
msgstr ""

#: warehouse/templates/manage/account.html:695
#: warehouse/templates/manage/account.html:703
#: warehouse/templates/manage/history.html:89
#: warehouse/templates/manage/history.html:98
#: warehouse/templates/manage/history.html:94
#: warehouse/templates/manage/history.html:103
msgid "Date / time"
msgstr ""

#: warehouse/templates/manage/account.html:696
#: warehouse/templates/manage/account.html:707
#: warehouse/templates/manage/history.html:90
#: warehouse/templates/manage/history.html:102
#: warehouse/templates/manage/history.html:95
#: warehouse/templates/manage/history.html:107
msgid "IP address"
msgstr ""

Expand Down Expand Up @@ -2580,8 +2580,8 @@ msgid "This project has no releases"
msgstr ""

#: warehouse/templates/manage/projects.html:104
#: warehouse/templates/manage/releases.html:94
#: warehouse/templates/packaging/detail.html:356
#: warehouse/templates/manage/releases.html:100
#: warehouse/templates/packaging/detail.html:366
msgid "View"
msgstr ""

Expand Down Expand Up @@ -2624,8 +2624,8 @@ msgstr ""

#: warehouse/templates/manage/release.html:37
#: warehouse/templates/manage/release.html:48
#: warehouse/templates/packaging/detail.html:320
#: warehouse/templates/packaging/detail.html:331
#: warehouse/templates/packaging/detail.html:330
#: warehouse/templates/packaging/detail.html:341
msgid "Filename, size"
msgstr ""

Expand All @@ -2636,15 +2636,15 @@ msgstr ""

#: warehouse/templates/manage/release.html:39
#: warehouse/templates/manage/release.html:57
#: warehouse/templates/packaging/detail.html:322
#: warehouse/templates/packaging/detail.html:342
#: warehouse/templates/packaging/detail.html:332
#: warehouse/templates/packaging/detail.html:352
msgid "Python version"
msgstr ""

#: warehouse/templates/manage/release.html:40
#: warehouse/templates/manage/release.html:61
#: warehouse/templates/packaging/detail.html:323
#: warehouse/templates/packaging/detail.html:350
#: warehouse/templates/packaging/detail.html:333
#: warehouse/templates/packaging/detail.html:360
msgid "Upload date"
msgstr ""

Expand Down Expand Up @@ -2991,7 +2991,7 @@ msgid "No releases found"
msgstr ""

#: warehouse/templates/manage/releases.html:207
#, python-format
#, python-format
msgid ""
"Learn how to create a new release on the <a href=\"%(href)s\" "
"title=\"%(title)s\" target=\"_blank\" rel=\"noopener\">Python Packaging "
Expand Down Expand Up @@ -3529,98 +3529,98 @@ msgstr ""
msgid "Navigation"
msgstr ""

#: warehouse/templates/packaging/detail.html:170
#: warehouse/templates/packaging/detail.html:202
#: warehouse/templates/packaging/detail.html:180
#: warehouse/templates/packaging/detail.html:212
#, python-format
msgid "Navigation for %(project)s"
msgstr ""

#: warehouse/templates/packaging/detail.html:173
#: warehouse/templates/packaging/detail.html:205
#: warehouse/templates/packaging/detail.html:183
#: warehouse/templates/packaging/detail.html:215
msgid "Project description. Focus will be moved to the description."
msgstr ""

#: warehouse/templates/packaging/detail.html:175
#: warehouse/templates/packaging/detail.html:207
#: warehouse/templates/packaging/detail.html:235
#: warehouse/templates/packaging/detail.html:185
#: warehouse/templates/packaging/detail.html:217
#: warehouse/templates/packaging/detail.html:245
msgid "Project description"
msgstr ""

#: warehouse/templates/packaging/detail.html:179
#: warehouse/templates/packaging/detail.html:217
#: warehouse/templates/packaging/detail.html:189
#: warehouse/templates/packaging/detail.html:227
msgid "Release history. Focus will be moved to the history panel."
msgstr ""

#: warehouse/templates/packaging/detail.html:181
#: warehouse/templates/packaging/detail.html:219
#: warehouse/templates/packaging/detail.html:257
#: warehouse/templates/packaging/detail.html:191
#: warehouse/templates/packaging/detail.html:229
#: warehouse/templates/packaging/detail.html:267
msgid "Release history"
msgstr ""

#: warehouse/templates/packaging/detail.html:186
#: warehouse/templates/packaging/detail.html:224
#: warehouse/templates/packaging/detail.html:196
#: warehouse/templates/packaging/detail.html:234
msgid "Download files. Focus will be moved to the project files."
msgstr ""

#: warehouse/templates/packaging/detail.html:188
#: warehouse/templates/packaging/detail.html:226
#: warehouse/templates/packaging/detail.html:313
#: warehouse/templates/packaging/detail.html:198
#: warehouse/templates/packaging/detail.html:236
#: warehouse/templates/packaging/detail.html:323
msgid "Download files"
msgstr ""

#: warehouse/templates/packaging/detail.html:211
#: warehouse/templates/packaging/detail.html:221
msgid "Project details. Focus will be moved to the project details."
msgstr ""

#: warehouse/templates/packaging/detail.html:213
#: warehouse/templates/packaging/detail.html:249
#: warehouse/templates/packaging/detail.html:223
#: warehouse/templates/packaging/detail.html:259
msgid "Project details"
msgstr ""

#: warehouse/templates/packaging/detail.html:242
#: warehouse/templates/packaging/detail.html:252
msgid "The author of this package has not provided a project description"
msgstr ""

#: warehouse/templates/packaging/detail.html:259
#: warehouse/templates/packaging/detail.html:269
msgid "Release notifications"
msgstr ""

#: warehouse/templates/packaging/detail.html:260
#: warehouse/templates/packaging/detail.html:270
msgid "RSS feed"
msgstr ""

#: warehouse/templates/packaging/detail.html:272
#: warehouse/templates/packaging/detail.html:282
msgid "This version"
msgstr ""

#: warehouse/templates/packaging/detail.html:292
#: warehouse/templates/packaging/detail.html:302
msgid "pre-release"
msgstr ""

#: warehouse/templates/packaging/detail.html:297
#: warehouse/templates/packaging/detail.html:307
msgid "yanked"
msgstr ""

#: warehouse/templates/packaging/detail.html:314
#: warehouse/templates/packaging/detail.html:324
#, python-format
msgid ""
"Download the file for your platform. If you're not sure which to choose, "
"learn more about <a href=\"%(href)s\" title=\"%(title)s\" "
"target=\"_blank\" rel=\"noopener\">installing packages</a>."
msgstr ""

#: warehouse/templates/packaging/detail.html:317
#: warehouse/templates/packaging/detail.html:327
#, python-format
msgid "Files for %(project_name)s, version %(version)s"
msgstr ""

#: warehouse/templates/packaging/detail.html:321
#: warehouse/templates/packaging/detail.html:338
#: warehouse/templates/packaging/detail.html:331
#: warehouse/templates/packaging/detail.html:348
msgid "File type"
msgstr ""

#: warehouse/templates/packaging/detail.html:324
#: warehouse/templates/packaging/detail.html:354
#: warehouse/templates/packaging/detail.html:334
#: warehouse/templates/packaging/detail.html:364
msgid "Hashes"
msgstr ""

Expand Down
11 changes: 10 additions & 1 deletion warehouse/migrations/versions/93388f06f5e7_draft_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,16 @@
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("releases", sa.Column("project_name", sa.Text(), nullable=True))
op.add_column("releases", sa.Column("published", sa.DateTime(), nullable=True))
op.add_column(
"releases",
sa.Column(
"published",
sa.DateTime(),
# Drop this default later and set its value explicitly (Null or Now())
server_default=sa.text("now()"),
nullable=True,
),
)
# ### end Alembic commands ###
# Fill the project_name and published columns
op.execute(
Expand Down
4 changes: 3 additions & 1 deletion warehouse/packaging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ def __table_args__(cls): # noqa
created = Column(
DateTime(timezone=False), nullable=False, server_default=sql.func.now()
)
published = Column(DateTime(timezone=False), nullable=True)
published = Column(
DateTime(timezone=False), nullable=True, server_default=sql.func.now()
)

description_id = Column(
ForeignKey("release_descriptions.id", onupdate="CASCADE", ondelete="CASCADE"),
Expand Down

0 comments on commit 380accc

Please sign in to comment.