Skip to content

Commit

Permalink
Merge branch 'master' into vi-ar
Browse files Browse the repository at this point in the history
  • Loading branch information
fci-jenkins committed Oct 16, 2013
2 parents d72a42b + 750c9cc commit 1d36d87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion elections/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def automatically_create_election(sender, instance, created, **kwargs):
)

if getattr(settings, 'USE_POPIT', True):
popit_api_instance_url = settings.POPIT_API_URL% ( election.slug)
short_slug = hex(hash(election.slug))
popit_api_instance_url = settings.POPIT_API_URL% ( short_slug)

popit_api_instance = PopitApiInstance.objects.create(
url = popit_api_instance_url
Expand Down
4 changes: 3 additions & 1 deletion elections/tests/candideitorg_popit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def test_it_creates_a_popit_API_client(self):

api_instance = can_election.election.popit_api_instance

expected_url = settings.POPIT_API_URL % ( can_election.election.slug )
short_slug = hex(hash(can_election.election.slug))

expected_url = settings.POPIT_API_URL % ( short_slug )
self.assertEquals(api_instance.url, expected_url)


Expand Down

0 comments on commit 1d36d87

Please sign in to comment.