From bc2429234abd4695f5421070ea945c7aa7a88a06 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Fri, 22 Jan 2016 09:07:07 +0100
Subject: [PATCH] Fix bug in country name display

---
 scipost/forms.py  |  2 +-
 scipost/models.py | 11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/scipost/forms.py b/scipost/forms.py
index 8b1894af0..9a44888e9 100644
--- a/scipost/forms.py
+++ b/scipost/forms.py
@@ -22,7 +22,7 @@ class RegistrationForm(forms.Form):
     email = forms.EmailField(label='email')
     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}">'))
-    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)
     #address = forms.CharField(label='Address', max_length=1000)
     personalwebpage = forms.URLField(label='Personal web page')
diff --git a/scipost/models.py b/scipost/models.py
index 759b4f831..90ef55f92 100644
--- a/scipost/models.py
+++ b/scipost/models.py
@@ -49,8 +49,8 @@ class Contributor(models.Model):
     title = models.CharField(max_length=4, choices=TITLE_CHOICES)
     # username, password, email, first_name and last_name are inherited from User
     orcid_id = models.CharField(max_length=20, verbose_name="ORCID id")
-    nationality = CountryField(default='NL')
-    country_of_employment = CountryField(default='NL')
+    nationality = CountryField()
+    country_of_employment = CountryField()
     affiliation = models.CharField(max_length=300, verbose_name='affiliation')
     #address = models.CharField(max_length=1000, verbose_name="address")
     personalwebpage = models.URLField(verbose_name='personal web page')
@@ -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>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>Nationality: </td><td>&nbsp;</td><td>' + 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>Nationality: </td><td>&nbsp;</td><td>' + str(self.nationality.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>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>'
@@ -134,3 +134,6 @@ class Contributor(models.Model):
             output += '<tr><td>Can vet submitted reports</td></tr>'
         output += '</table>'
         return output
+
+
+#class LeadEditorGroup(models.Group)
-- 
GitLab