summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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()