From 53c4ac36db08a5b4e5a5eb268aebcc1328395f78 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Fri, 27 Apr 2018 14:00:33 +0000 Subject: [PATCH] Removed the Person.address field, which is not being used. This was a legacy from the 2001 perl-based datatracker tables. Fixes issue #2504. - Legacy-Id: 15095 --- ietf/doc/tests_draft.py | 2 +- ietf/ietfauth/tests.py | 1 - ietf/nomcom/tests.py | 2 +- ietf/nomcom/utils.py | 2 +- .../migrations/0003_auto_20180426_0517.py | 23 +++++++++++++++++++ ietf/person/models.py | 1 - ietf/person/utils.py | 2 +- ietf/secr/rolodex/tests.py | 2 -- ietf/utils/test_data.py | 2 +- 9 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 ietf/person/migrations/0003_auto_20180426_0517.py diff --git a/ietf/doc/tests_draft.py b/ietf/doc/tests_draft.py index 9071cc0e8..3c94e4723 100644 --- a/ietf/doc/tests_draft.py +++ b/ietf/doc/tests_draft.py @@ -1435,7 +1435,7 @@ class ChangeReplacesTests(TestCase): expires=datetime.datetime.now() + datetime.timedelta(days=settings.INTERNET_DRAFT_DAYS_TO_EXPIRE), group=mars_wg, ) - p = Person.objects.create(address="basea_author") + p = Person.objects.create(name="basea_author") e = Email.objects.create(address="basea_author@example.com", person=p) self.basea.documentauthor_set.create(person=p, email=e, order=1) diff --git a/ietf/ietfauth/tests.py b/ietf/ietfauth/tests.py index fba73e529..270202d8f 100644 --- a/ietf/ietfauth/tests.py +++ b/ietf/ietfauth/tests.py @@ -207,7 +207,6 @@ class IetfAuthTests(TestCase): "name": u"Test NĂ£me", "ascii": u"Test Name", "ascii_short": u"T. Name", - "address": "Test address", "affiliation": "Test Org", "active_emails": email_address, } diff --git a/ietf/nomcom/tests.py b/ietf/nomcom/tests.py index 6a710f437..1720a8209 100644 --- a/ietf/nomcom/tests.py +++ b/ietf/nomcom/tests.py @@ -694,7 +694,7 @@ class NomcomViewsTest(TestCase): # check objects email = Email.objects.get(address=candidate_email) - Person.objects.get(name=candidate_name, address=candidate_email) + Person.objects.get(name=candidate_name) nominee = Nominee.objects.get(email=email) NomineePosition.objects.get(position=position, nominee=nominee) feedback = Feedback.objects.filter(positions__in=[position], diff --git a/ietf/nomcom/utils.py b/ietf/nomcom/utils.py index 54ff1ec69..4d999da9b 100644 --- a/ietf/nomcom/utils.py +++ b/ietf/nomcom/utils.py @@ -375,7 +375,7 @@ def make_nomineeposition_for_newperson(nomcom, candidate_name, candidate_email, email = Email.objects.create(address=candidate_email) person = Person.objects.create(name=candidate_name, ascii=unidecode_name(candidate_name), - address=candidate_email) + ) email.person = person email.save() diff --git a/ietf/person/migrations/0003_auto_20180426_0517.py b/ietf/person/migrations/0003_auto_20180426_0517.py new file mode 100644 index 000000000..0cad90d03 --- /dev/null +++ b/ietf/person/migrations/0003_auto_20180426_0517.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.12 on 2018-04-26 05:17 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('person', '0002_auto_20180330_0808'), + ] + + operations = [ + migrations.RemoveField( + model_name='person', + name='address', + ), + migrations.RemoveField( + model_name='personhistory', + name='address', + ), + ] diff --git a/ietf/person/models.py b/ietf/person/models.py index 886802b83..36a51d00e 100644 --- a/ietf/person/models.py +++ b/ietf/person/models.py @@ -37,7 +37,6 @@ class PersonInfo(models.Model): # The short ascii-form of the name. Also in alias table if non-null ascii_short = models.CharField("Abbreviated Name (ASCII)", max_length=32, null=True, blank=True, help_text="Example: A. Nonymous. Fill in this with initials and surname only if taking the initials and surname of the ASCII name above produces an incorrect initials-only form. (Blank is OK).") affiliation = models.CharField(max_length=255, blank=True, help_text="Employer, university, sponsor, etc.") - address = models.TextField(max_length=255, blank=True, help_text="Postal mailing address.") biography = models.TextField(blank=True, help_text="Short biography for use on leadership pages. Use plain text or reStructuredText markup.") photo = models.ImageField(storage=NoLocationMigrationFileSystemStorage(), upload_to=settings.PHOTOS_DIRNAME, blank=True, default=None) photo_thumb = models.ImageField(storage=NoLocationMigrationFileSystemStorage(), upload_to=settings.PHOTOS_DIRNAME, blank=True, default=None) diff --git a/ietf/person/utils.py b/ietf/person/utils.py index 5909eacf7..ab8382322 100755 --- a/ietf/person/utils.py +++ b/ietf/person/utils.py @@ -34,7 +34,7 @@ def merge_persons(source, target, file=sys.stdout, verbose=False): dedupe_aliases(target) # copy other attributes - for field in ('ascii','ascii_short','address','affiliation'): + for field in ('ascii','ascii_short','affiliation'): if getattr(source,field) and not getattr(target,field): setattr(target,field,getattr(source,field)) target.save() diff --git a/ietf/secr/rolodex/tests.py b/ietf/secr/rolodex/tests.py index 468526dd3..9616e8f66 100644 --- a/ietf/secr/rolodex/tests.py +++ b/ietf/secr/rolodex/tests.py @@ -41,7 +41,6 @@ class RolodexTestCase(TestCase): 'ascii': 'Joe Smith', 'ascii_short': 'Joe S', 'affiliation': 'IETF', - 'address': '100 First Ave', 'email': 'joes@exanple.com', 'submit': 'Submit', } @@ -63,7 +62,6 @@ class RolodexTestCase(TestCase): 'ascii': person.ascii, 'ascii_short': person.ascii_short, 'affiliation': person.affiliation, - 'address': person.address, 'user': user.username, 'email-0-person':person.pk, 'email-0-address': person.email_address(), diff --git a/ietf/utils/test_data.py b/ietf/utils/test_data.py index 2d912602d..a8a56a8d4 100644 --- a/ietf/utils/test_data.py +++ b/ietf/utils/test_data.py @@ -60,7 +60,7 @@ def make_immutable_base_data(): date4 = TelechatDate.objects.create(date=t + datetime.timedelta(days=14 * 3)).date # pyflakes:ignore # system - system_person = Person.objects.create(name="(System)", ascii="(System)", address="") + system_person = Person.objects.create(name="(System)", ascii="(System)") Email.objects.create(address="", person=system_person) # high-level groups