-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1281 update shipping info #1506
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Front end validation looks good to me, but there were a couple of interactions with saving/loading that should be addressed.
@@ -47,6 +47,7 @@ class NmcdAddress(BaseModel): | |||
city: str | |||
state: str | |||
postalCode: str | |||
country: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
country: str | |
country: str = "" |
I came across a 500
status code when loading the submission landing page. Looks like there's some backend validation that is not happy.
Since country
is a new required field, we need to stay backwards-compatible with existing submissions. There are a couple of options.
- We could have the serializer add a default value (empty string?)
- We could write a migration to add a default value
I don't mind sticking with option 1, but we also need to make sure that any consumers of this data are aware that country
might be missing (I'm not sure how robust the submission to mongo pipeline is about this).
I also don't know what the default value should be. The empty string allows us to sneak existing submissions past the pydantic classes, but these submissions are still technically invalid. It's probably fine though.
@@ -110,6 +111,7 @@ const addressFormDefault = { | |||
const contextFormDefault = { | |||
dataGenerated: undefined as undefined | boolean, | |||
awardDois: [] as string[] | null, | |||
ship: undefined as undefined | boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this also needs to be added to the pydantic class in schemas_submission.py
. Otherwise users will have to select an option for this each time they open the submission.
Closes #1281
Included in this PR