From 475ebf909f24ece1b599fd7524ba22e0489fa5b4 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Mon, 25 Jan 2016 06:46:50 +0100 Subject: [PATCH] Remove nationality from Contributor --- scipost/forms.py | 8 +++++--- scipost/models.py | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scipost/forms.py b/scipost/forms.py index f347e1f01..c058e5e1d 100644 --- a/scipost/forms.py +++ b/scipost/forms.py @@ -22,7 +22,7 @@ class RegistrationForm(forms.Form): last_name = forms.CharField(label='* Last name', max_length=100) email = forms.EmailField(label='* Email address') orcid_id = forms.CharField(label=" ORCID id", max_length=20, widget=forms.TextInput({'placeholder': 'Recommended. Get one at orcid.org'}), required=False) - nationality = LazyTypedChoiceField(choices=countries, label='Nationality', initial='CA', required=False, widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">')) + #nationality = LazyTypedChoiceField(choices=countries, label='Nationality', initial='CA', required=False, 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, label='* Country of employment', 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, widget=forms.TextInput({'placeholder': 'For postal correspondence'}), required=False) @@ -65,8 +65,10 @@ class UpdatePersonalDataForm(forms.ModelForm): #fields = ['title', 'first_name', 'last_name', 'email', 'orcid_id', 'affiliation', 'address', 'personalwebpage'] #fields = ['title', 'orcid_id', 'affiliation', 'address', 'personalwebpage'] #fields = ['title', 'orcid_id', 'affiliation', 'personalwebpage'] - fields = ['title', 'orcid_id', 'nationality', 'country_of_employment', 'affiliation', 'address', 'personalwebpage'] - widgets = {'nationality': CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">'), 'country_of_employment': CountrySelectWidget()} + #fields = ['title', 'orcid_id', 'nationality', 'country_of_employment', 'affiliation', 'address', 'personalwebpage'] + #widgets = {'nationality': CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">'), 'country_of_employment': CountrySelectWidget()} + fields = ['title', 'orcid_id', 'country_of_employment', 'affiliation', 'address', 'personalwebpage'] + widgets = {'country_of_employment': CountrySelectWidget()} class VetRegistrationForm(forms.Form): promote_to_rank_1 = forms.BooleanField(required=False) diff --git a/scipost/models.py b/scipost/models.py index e2d9ba3fb..2aefe515a 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -51,8 +51,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", blank=True) - nationality = CountryField(default='CA', blank=True) - country_of_employment = CountryField(default='NL') + #nationality = CountryField(blank=True) + country_of_employment = CountryField() affiliation = models.CharField(max_length=300, verbose_name='affiliation') address = models.CharField(max_length=1000, verbose_name="address", default='', blank=True) personalwebpage = models.URLField(verbose_name='personal web page', blank=True) @@ -112,7 +112,7 @@ class Contributor(models.Model): output += '<tr><td>Last name: </td><td> </td><td>' + self.user.last_name + '</td></tr>' output += '<tr><td>Email: </td><td> </td><td>' + self.user.email + '</td></tr>' output += '<tr><td>ORCID id: </td><td> </td><td>' + self.orcid_id + '</td></tr>' - output += '<tr><td>Nationality: </td><td> </td><td>' + str(self.nationality.name) + '</td></tr>' + #output += '<tr><td>Nationality: </td><td> </td><td>' + str(self.nationality.name) + '</td></tr>' output += '<tr><td>Country of employment: </td><td> </td><td>' + str(self.country_of_employment.name) + '</td></tr>' output += '<tr><td>Affiliation: </td><td> </td><td>' + self.affiliation + '</td></tr>' output += '<tr><td>Address: </td><td> </td><td>' + self.address + '</td></tr>' -- GitLab