Skip to content

Commit

Permalink
Merge pull request #1131 from toladata/revert-ticket-434
Browse files Browse the repository at this point in the history
Revert "add address field to organization"
  • Loading branch information
jefmoura authored Aug 14, 2018
2 parents ff1cee4 + 040bfce commit 4031840
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 38 deletions.
7 changes: 7 additions & 0 deletions tola/management/commands/loadinitialdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ def _create_site_profiles(self):
latitude="33.500",
longitude="36.300",
created_by=self._tolauser_ninette.user, # 11
organization=self._organization,
))

self._site_profiles.append(factories.SiteProfile(
Expand All @@ -1026,6 +1027,7 @@ def _create_site_profiles(self):
latitude="36.2130824982",
longitude="37.1569335937",
created_by=self._tolauser_ninette.user, # 11
organization=self._organization,
))

self._site_profiles.append(factories.SiteProfile(
Expand All @@ -1035,6 +1037,7 @@ def _create_site_profiles(self):
latitude="35.1421960686",
longitude="36.7504394531",
created_by=self._tolauser_ninette.user, # 11
organization=self._organization,
))

self._site_profiles.append(factories.SiteProfile(
Expand All @@ -1044,6 +1047,7 @@ def _create_site_profiles(self):
latitude="34.8959",
longitude="35.8867",
created_by=self._tolauser_ninette.user, # 11
organization=self._organization,
))

self._site_profiles.append(factories.SiteProfile(
Expand All @@ -1053,6 +1057,7 @@ def _create_site_profiles(self):
latitude="34.7369225399",
longitude="36.7284667969",
created_by=self._tolauser_ninette.user, # 11
organization=self._organization,
))

self._site_profiles.append(factories.SiteProfile(
Expand All @@ -1062,6 +1067,7 @@ def _create_site_profiles(self):
latitude="50.9692657293000000",
longitude="6.9889383750000000",
created_by=self._tolauser_ninette.user,
organization=self._organization,
))

self._site_profiles.append(factories.SiteProfile(
Expand All @@ -1071,6 +1077,7 @@ def _create_site_profiles(self):
latitude="49.4507464458000000",
longitude="11.0319071250000000",
created_by=self._tolauser_ninette.user,
organization=self._organization,
))

def _create_stakeholders(self):
Expand Down
2 changes: 1 addition & 1 deletion tola/management/commands/tests/test_loadinitialdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def test_restore_having_historical_dependent_data(self):
organization = factories.Organization(name='Some org')
country = factories.Country(country='Brazil', code='BR')
factories.SiteProfile(organization=organization, country=country)
siteprofile_history_id = SiteProfile.history.get(country=country).id
siteprofile_history_id = SiteProfile.history.get(organization=organization).id

args = ['--demo']
opts = {}
Expand Down
29 changes: 0 additions & 29 deletions workflow/migrations/0027_auto_20180810_0530.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Migration(migrations.Migration):

dependencies = [
('workflow', '0027_auto_20180810_0530'),
('workflow', '0026_organization_phone'),
]

operations = [
Expand Down
2 changes: 1 addition & 1 deletion workflow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ class Organization(models.Model):
currency_format = models.CharField("Currency Format", max_length=50, blank=True, default="Commas")
allow_budget_decimal = models.BooleanField("Allow Budget in Decimal", default=True)
phone = models.CharField(max_length=20, blank=True, null=True)
site = models.ForeignKey("SiteProfile", blank=True, null=True)

class Meta:
ordering = ('name',)
Expand Down Expand Up @@ -949,6 +948,7 @@ class SiteProfile(models.Model):
approval = models.ManyToManyField(ApprovalWorkflow, blank=True)
create_date = models.DateTimeField(null=True, blank=True)
edit_date = models.DateTimeField(null=True, blank=True)
organization = models.ForeignKey(Organization, null=True, blank=True)
workflowlevel1 = models.ManyToManyField(WorkflowLevel1, blank=True)
created_by = models.ForeignKey('auth.User', related_name='sites', null=True, blank=True)
history = HistoricalRecords()
Expand Down
6 changes: 0 additions & 6 deletions workflow/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,3 @@ def test_save_phone(self):
organization = factories.Organization(phone="+49 123 456 111")
self.assertEqual(organization.phone, "+49 123 456 111")

def test_save_organization_with_siteprofile(self):
country = factories.Country(country='Germany')
siteprofile = factories.SiteProfile(name='Headquarter',
country=country)
organization = factories.Organization(site=siteprofile)
self.assertEqual(organization.site.name, 'Headquarter')

0 comments on commit 4031840

Please sign in to comment.