aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Copeland <ben.copeland@linaro.org>2016-12-16 11:51:51 +0000
committerBen Copeland <ben.copeland@linaro.org>2016-12-16 16:21:13 +0000
commitc7e6b4253ffef89cd34823a76c682b4edbe74395 (patch)
tree97ab41accec48f83f553f2b58595b6d96389cb05
parent39994d86e93a1e23172d69442ad35d07d906c1ee (diff)
downloadlinaro-license-protection-c7e6b4253ffef89cd34823a76c682b4edbe74395.tar.gz
http-ref: field length fix-up
Change-Id: Iebcddc2995bd9d1bed1b071fb020c825604cdf3b Reviewed-on: https://review.linaro.org/16452 Reviewed-by: Andy Doan <andy.doan@linaro.org>
-rw-r--r--license_protected_downloads/migrations/0003_auto_20161216_1137.py19
-rw-r--r--license_protected_downloads/models.py4
2 files changed, 21 insertions, 2 deletions
diff --git a/license_protected_downloads/migrations/0003_auto_20161216_1137.py b/license_protected_downloads/migrations/0003_auto_20161216_1137.py
new file mode 100644
index 0000000..1c2aed0
--- /dev/null
+++ b/license_protected_downloads/migrations/0003_auto_20161216_1137.py
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('license_protected_downloads', '0002_download_ref'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='download',
+ name='ref',
+ field=models.CharField(max_length=4096, null=True, blank=True),
+ ),
+ ]
diff --git a/license_protected_downloads/models.py b/license_protected_downloads/models.py
index 18f8c67..f9e8f15 100644
--- a/license_protected_downloads/models.py
+++ b/license_protected_downloads/models.py
@@ -138,7 +138,7 @@ class Download(models.Model):
country = models.CharField(max_length=256, blank=True, null=True)
region_isp = models.CharField(max_length=256, blank=True, null=True)
- ref = models.CharField(max_length=256, blank=True, null=True)
+ ref = models.CharField(max_length=4096, blank=True, null=True)
@staticmethod
def mark(request, artifact):
@@ -159,7 +159,7 @@ class Download(models.Model):
ref = http_ref.replace('\n', '').replace(',', '')
with open(settings.REPORT_CSV, "a") as f:
writer = csv.writer(f)
- writer.writerow([ip, name, link, ref])
+ writer.writerow([ip, name, link, ref[:4096]])
except:
logging.exception('unable to mark download')