Bug 591353: Allow to pin down some important configs of big ISPs #10

Merged
merged 2 commits into from Aug 20, 2012

Conversation

Projects
None yet
2 participants
Contributor

sergiocharpineljr commented Aug 17, 2012

Add to Config a boolean locked attr (which can be changed using admin interface).

@bwinton bwinton commented on the diff Aug 17, 2012

ispdb/tests/test_approve.py
@@ -22,6 +22,17 @@ def test_unauthenticated_user(self):
goodRedirect = "/login/?next=%s" % (quote_plus("/approve/1"))
self.assertRedirects(result, goodRedirect)
+ def test_locked_config(self):
+ config = Config.objects.get(id=1)
+ config.locked = True
+ config.save()
+ result = self.client.post("/approve/1", {
+ "approved": True,
+ }, follow=True)
+ config = Config.objects.get(id=1)
+ # Should not have changed the config
+ assert_equal(config.status, 'requested')
@bwinton

bwinton Aug 17, 2012

Member

For this, and the rest of the tests, I think we should also check that there was an error in the result.

@bwinton bwinton commented on the diff Aug 17, 2012

ispdb/config/models.py
@@ -77,7 +77,7 @@ def __unicode__(self):
on_delete=models.SET_NULL)
last_update_datetime = models.DateTimeField(auto_now=True)
created_datetime = models.DateTimeField(auto_now_add=True)
- deleted_datetime = models.DateTimeField(null=True)
+ deleted_datetime = models.DateTimeField(null=True, blank=True)
@bwinton

bwinton Aug 17, 2012

Member

Why do you need the extra "blank=True" here?

@sergiocharpineljr

sergiocharpineljr Aug 17, 2012

Contributor

When we update the locked field on admin page it complains about these values being blank (if we don't set blank=True)

@bwinton bwinton added a commit that referenced this pull request Aug 20, 2012

@bwinton bwinton Merge pull request #10 from sergiocharpineljr/bug_591353
Bug 591353: Allow to pin down some important configs of big ISPs
6d3e8a7

@bwinton bwinton merged commit 6d3e8a7 into mozilla:master Aug 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment