*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 3c12d062 authored by Moser, Maximilian's avatar Moser, Maximilian
Browse files

Ensure the TISS ID in the registration form is a number

parent 235cccc5
Branches main
No related tags found
1 merge request!31InvenioRDM v12
...@@ -71,8 +71,16 @@ def tuw_registration_form(*args, **kwargs): ...@@ -71,8 +71,16 @@ def tuw_registration_form(*args, **kwargs):
curation_consent = BooleanField(curation_consent_message, default="checked") curation_consent = BooleanField(curation_consent_message, default="checked")
terms_of_use = BooleanField(message, [validators.required()]) terms_of_use = BooleanField(message, [validators.required()])
def _get_tiss_id(self):
"""Parse the TISS ID value into a number."""
try:
return int(self.user_profile.tiss_id.data)
except Exception:
return None
def to_dict(self): def to_dict(self):
"""Turn the form into a dictionary.""" """Turn the form into a dictionary."""
return { return {
"email": self.email.data, "email": self.email.data,
"username": self.username.data, "username": self.username.data,
...@@ -82,7 +90,7 @@ def tuw_registration_form(*args, **kwargs): ...@@ -82,7 +90,7 @@ def tuw_registration_form(*args, **kwargs):
"given_name": self.user_profile.given_name.data, "given_name": self.user_profile.given_name.data,
"family_name": self.user_profile.family_name.data, "family_name": self.user_profile.family_name.data,
"affiliations": self.user_profile.affiliations.data, "affiliations": self.user_profile.affiliations.data,
"tiss_id": self.user_profile.tiss_id.data, "tiss_id": self._get_tiss_id(),
}, },
"preferences": { "preferences": {
"visibility": self.preferences.visibility.data, "visibility": self.preferences.visibility.data,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment