SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit bc242923 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Fix bug in country name display

parent 5e854d2d
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ class RegistrationForm(forms.Form): ...@@ -22,7 +22,7 @@ class RegistrationForm(forms.Form):
email = forms.EmailField(label='email') email = forms.EmailField(label='email')
orcid_id = forms.CharField(label="ORCID id", max_length=20) orcid_id = forms.CharField(label="ORCID id", max_length=20)
nationality = LazyTypedChoiceField(choices=countries, initial='CA', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">')) nationality = LazyTypedChoiceField(choices=countries, initial='CA', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">'))
country_of_employment = LazyTypedChoiceField(choices=countries, initial='CA', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">')) country_of_employment = LazyTypedChoiceField(choices=countries, initial='NL', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">'))
affiliation = forms.CharField(label='Affiliation', max_length=300) affiliation = forms.CharField(label='Affiliation', max_length=300)
#address = forms.CharField(label='Address', max_length=1000) #address = forms.CharField(label='Address', max_length=1000)
personalwebpage = forms.URLField(label='Personal web page') personalwebpage = forms.URLField(label='Personal web page')
......
...@@ -49,8 +49,8 @@ class Contributor(models.Model): ...@@ -49,8 +49,8 @@ class Contributor(models.Model):
title = models.CharField(max_length=4, choices=TITLE_CHOICES) title = models.CharField(max_length=4, choices=TITLE_CHOICES)
# username, password, email, first_name and last_name are inherited from User # username, password, email, first_name and last_name are inherited from User
orcid_id = models.CharField(max_length=20, verbose_name="ORCID id") orcid_id = models.CharField(max_length=20, verbose_name="ORCID id")
nationality = CountryField(default='NL') nationality = CountryField()
country_of_employment = CountryField(default='NL') country_of_employment = CountryField()
affiliation = models.CharField(max_length=300, verbose_name='affiliation') affiliation = models.CharField(max_length=300, verbose_name='affiliation')
#address = models.CharField(max_length=1000, verbose_name="address") #address = models.CharField(max_length=1000, verbose_name="address")
personalwebpage = models.URLField(verbose_name='personal web page') personalwebpage = models.URLField(verbose_name='personal web page')
...@@ -110,8 +110,8 @@ class Contributor(models.Model): ...@@ -110,8 +110,8 @@ class Contributor(models.Model):
output += '<tr><td>Last name: </td><td>&nbsp;</td><td>' + self.user.last_name + '</td></tr>' output += '<tr><td>Last name: </td><td>&nbsp;</td><td>' + self.user.last_name + '</td></tr>'
output += '<tr><td>Email: </td><td>&nbsp;</td><td>' + self.user.email + '</td></tr>' output += '<tr><td>Email: </td><td>&nbsp;</td><td>' + self.user.email + '</td></tr>'
output += '<tr><td>ORCID id: </td><td>&nbsp;</td><td>' + self.orcid_id + '</td></tr>' output += '<tr><td>ORCID id: </td><td>&nbsp;</td><td>' + self.orcid_id + '</td></tr>'
output += '<tr><td>Nationality: </td><td>&nbsp;</td><td>' + self.nationality.name + '</td></tr>' output += '<tr><td>Nationality: </td><td>&nbsp;</td><td>' + str(self.nationality.name) + '</td></tr>'
output += '<tr><td>Country of employment: </td><td>&nbsp;</td><td>' + self.country_of_employment.name + '</td></tr>' output += '<tr><td>Country of employment: </td><td>&nbsp;</td><td>' + str(self.country_of_employment.name) + '</td></tr>'
output += '<tr><td>Affiliation: </td><td>&nbsp;</td><td>' + self.affiliation + '</td></tr>' output += '<tr><td>Affiliation: </td><td>&nbsp;</td><td>' + self.affiliation + '</td></tr>'
#output += '<tr><td>Address: </td><td>&nbsp;</td><td>' + self.address + '</td></tr>' #output += '<tr><td>Address: </td><td>&nbsp;</td><td>' + self.address + '</td></tr>'
output += '<tr><td>Personal web page: </td><td>&nbsp;</td><td>' + self.personalwebpage + '</td></tr>' output += '<tr><td>Personal web page: </td><td>&nbsp;</td><td>' + self.personalwebpage + '</td></tr>'
...@@ -134,3 +134,6 @@ class Contributor(models.Model): ...@@ -134,3 +134,6 @@ class Contributor(models.Model):
output += '<tr><td>Can vet submitted reports</td></tr>' output += '<tr><td>Can vet submitted reports</td></tr>'
output += '</table>' output += '</table>'
return output return output
#class LeadEditorGroup(models.Group)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment