Validate and submit the entered author's profile.
Source code in src/careamics_napari/bmz/author_widget.py
| def submit_author(self) -> None:
"""Validate and submit the entered author's profile."""
author_data = {
"name": self._get_value(self.name_txtbox.text()),
"email": self._get_value(self.email_txtbox.text()),
"affiliation": self._get_value(self.affiliation_txtbox.text()),
"github_user": self._get_value(self.git_user_txtbox.text()),
"orcid": self._get_value(self.orcid_txtbox.text()),
}
# validation
try:
author = AuthorModel.model_validate(author_data)
except Exception as err:
print(err)
if _has_napari:
ntf.show_error("Not a valid author!")
return
# submit
self.submit.emit(author)
self.close()
|