From 400e17d3750cd9bd9d8719a382c79f36d6c40346 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Thu, 12 Dec 2024 05:16:02 -0500 Subject: [PATCH] Fix import wizard (#11842) I think this fixes it (at least makes .com tests green), but we don't have tests for this, so not sure if it doesn't break anything else. @humitos you may want to test it locally. ref https://read-the-docs.sentry.io/issues/6127455073/?project=161479&query=is%3Aunresolved&referrer=issue-stream&sort=trends&statsPeriod=90d&stream_index=3 --------- Co-authored-by: Manuel Kaufmann --- readthedocs/projects/views/private.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/readthedocs/projects/views/private.py b/readthedocs/projects/views/private.py index 470378d0191..d90dd977427 100644 --- a/readthedocs/projects/views/private.py +++ b/readthedocs/projects/views/private.py @@ -323,8 +323,11 @@ def show_config_step(wizard): don't show this step. """ - # try to get the cleaned data of step 1 - cleaned_data = wizard.get_cleaned_data_for_step("basics") or {} + # Try to get the cleaned data from the "basics" step only if + # we are in a step after it, otherwise, return True since we don't + # have the data yet, and django-forms calls this function multiple times. + basics_step = "basics" + cleaned_data = wizard.get_cleaned_data_for_step(basics_step) or {} repo = cleaned_data.get("repo") remote_repository = cleaned_data.get("remote_repository") default_branch = cleaned_data.get("default_branch")