Skip to content

Commit dc6b05c

Browse files
Fix Organization Application State Corruption on Invalid Information Requests (#20302)
Co-authored-by: Jacob Coffee <jacob@z7x.org>
1 parent 8bf1675 commit dc6b05c

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎tests/unit/organizations/test_services.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ def test_request_more_information_organization_application_no_message(
293293

294294
assert len(organization_application.observations) == 0
295295
send_email.assert_not_called()
296+
assert (
297+
organization_application.status == OrganizationApplicationStatus.Submitted
298+
)
296299

297300
def test_add_organization_application_note(self, db_request, organization_service):
298301
admin = UserFactory(username="admin", is_superuser=True)

‎warehouse/organizations/services.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ def request_more_information(self, organization_application_id, request):
256256
organization_application = self.get_organization_application(
257257
organization_application_id
258258
)
259-
organization_application.status = (
260-
OrganizationApplicationStatus.MoreInformationNeeded
261-
)
262259

263260
if message := request.params.get("message", ""):
261+
organization_application.status = (
262+
OrganizationApplicationStatus.MoreInformationNeeded
263+
)
264264
organization_application.record_observation(
265265
request=request,
266266
actor=request.user,

0 commit comments

Comments
 (0)