A newly registered user selects a product and proceeds to checkout. He has not updated his profile yet so the "Billing Information" and "Shipping Information" are just showing blank fields. The only required fields are "Email", "Last Name", "First Name" and "Phone Number". He fills in the "Phone Number" field and clicks on the "Continue Checkout" button. The following error is displayed:
invalid literal for int() with base 10: ''
The above error is because the country field is set to the first blank value "-----".
The best solution is to tell django it is ok to have an empty country value during the form submission process but I don't know enough about django to do that.
Instead, I have a workaround that uses shop.sales_country as the default value for the country field. Provided the user does not change the country field back to the first empty value, the checkout process can then proceed to the next step.