diff options
author | Dan McGee <dan@archlinux.org> | 2011-04-28 22:04:45 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-29 00:52:51 +0200 |
commit | b5be7d6fd60ade6af2fb9379fa43e3e93e60736e (patch) | |
tree | dc9ec06827b7b11ed22112d5bc1db07662d6bba2 | |
parent | cfb4f1bc6a45ddfc068acabc6efb9a4e350dd544 (diff) | |
download | archweb-b5be7d6fd60ade6af2fb9379fa43e3e93e60736e.tar.gz archweb-b5be7d6fd60ade6af2fb9379fa43e3e93e60736e.tar.xz |
isotests: record submission IP address
Helps a lot if we start seeing bogus submissions to track down and
suppress the issue.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | isotests/models.py | 3 | ||||
-rw-r--r-- | isotests/views.py | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/isotests/models.py b/isotests/models.py index 55c1bd0..1267fe8 100644 --- a/isotests/models.py +++ b/isotests/models.py @@ -99,7 +99,9 @@ class Bootloader(IsoOption): class Test(models.Model): user_name = models.CharField(max_length=500) user_email = models.EmailField() + ip_address = models.IPAddressField() created = models.DateTimeField(editable=False) + iso = models.ForeignKey(Iso) architecture = models.ForeignKey(Architecture) iso_type = models.ForeignKey(IsoType) @@ -115,6 +117,7 @@ class Test(models.Model): rollback_modules = models.ManyToManyField(Module, related_name="rollback_test_set", null=True, blank=True) bootloader = models.ForeignKey(Bootloader) + success = models.BooleanField() comments = models.TextField(null=True, blank=True) diff --git a/isotests/views.py b/isotests/views.py index 1d118d3..d988212 100644 --- a/isotests/views.py +++ b/isotests/views.py @@ -50,7 +50,9 @@ def add_result(request): if request.POST: form = TestForm(request.POST) if form.is_valid() and request.POST['website'] == '': - form.save() + test = form.save(commit=False) + test.ip_address = request.META.get("REMOTE_ADDR", None) + test.save() return HttpResponseRedirect('/isotests/thanks/') else: form = TestForm() |