Skip to content

Commit 1a78ba4

Browse files
authored
Take project name into account when checking for duplicate pending publishers (#18396)
* Take project name into account when checking for duplicate pending publishers * Fix a bad test * Update translations
1 parent 3bc1006 commit 1a78ba4

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

tests/unit/accounts/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4447,7 +4447,7 @@ def test_add_pending_oidc_publisher_invalid_form(
44474447
"organization": "some-org",
44484448
"project": "some-project",
44494449
"actor": "some-user",
4450-
"project_name": "some-other-project-name",
4450+
"project_name": "some-project-name",
44514451
}
44524452
),
44534453
),

warehouse/accounts/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,7 @@ def add_pending_google_oidc_publisher(self):
18141814
sub=form.sub.data,
18151815
),
18161816
make_existence_filters=lambda form: dict(
1817+
project_name=form.project_name.data,
18171818
email=form.email.data,
18181819
sub=form.sub.data,
18191820
),
@@ -1840,6 +1841,7 @@ def add_pending_github_oidc_publisher(self):
18401841
environment=form.normalized_environment,
18411842
),
18421843
make_existence_filters=lambda form: dict(
1844+
project_name=form.project_name.data,
18431845
repository_name=form.repository.data,
18441846
repository_owner=form.normalized_owner,
18451847
workflow_filename=form.workflow_filename.data,
@@ -1867,6 +1869,7 @@ def add_pending_activestate_oidc_publisher(self):
18671869
actor_id=form.actor_id,
18681870
),
18691871
make_existence_filters=lambda form: dict(
1872+
project_name=form.project_name.data,
18701873
organization=form.organization.data,
18711874
activestate_project_name=form.project.data,
18721875
actor_id=form.actor_id,
@@ -1893,6 +1896,7 @@ def add_pending_gitlab_oidc_publisher(self):
18931896
environment=form.normalized_environment,
18941897
),
18951898
make_existence_filters=lambda form: dict(
1899+
project_name=form.project_name.data,
18961900
namespace=form.namespace.data,
18971901
project=form.project.data,
18981902
workflow_filepath=form.workflow_filepath.data,

warehouse/locale/messages.pot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ msgstr ""
301301
msgid "Please review our updated <a href=\"${tos_url}\">Terms of Service</a>."
302302
msgstr ""
303303

304-
#: warehouse/accounts/views.py:1669 warehouse/accounts/views.py:1911
304+
#: warehouse/accounts/views.py:1669 warehouse/accounts/views.py:1915
305305
#: warehouse/manage/views/__init__.py:1409
306306
msgid ""
307307
"Trusted publishing is temporarily disabled. See https://pypi.org/help"
@@ -348,12 +348,12 @@ msgstr ""
348348
msgid "Registered a new pending publisher to create "
349349
msgstr ""
350350

351-
#: warehouse/accounts/views.py:1924 warehouse/accounts/views.py:1937
352-
#: warehouse/accounts/views.py:1944
351+
#: warehouse/accounts/views.py:1928 warehouse/accounts/views.py:1941
352+
#: warehouse/accounts/views.py:1948
353353
msgid "Invalid publisher ID"
354354
msgstr ""
355355

356-
#: warehouse/accounts/views.py:1951
356+
#: warehouse/accounts/views.py:1955
357357
msgid "Removed trusted publisher for project "
358358
msgstr ""
359359

0 commit comments

Comments
 (0)