summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-04-28 15:04:45 -0500
committerDan McGee <dan@archlinux.org>2011-04-28 17:52:51 -0500
commitb5be7d6fd60ade6af2fb9379fa43e3e93e60736e (patch)
treedc9ec06827b7b11ed22112d5bc1db07662d6bba2
parentcfb4f1bc6a45ddfc068acabc6efb9a4e350dd544 (diff)
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.py3
-rw-r--r--isotests/views.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/isotests/models.py b/isotests/models.py
index 55c1bd0d..1267fe85 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 1d118d3a..d9882128 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()