aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')