diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2018-02-04 12:41:26 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2018-02-04 12:41:26 -0500 |
| commit | 380dcdc86f5ac35d8112b0ff8693c4882e5f4d97 (patch) | |
| tree | de024c81317df6181229a738ecca9fc1e0174f6c | |
| parent | 4f2acad7c8ff56bbc41893be3cfaceb9a8d2175f (diff) | |
| download | dispatch-tracker-380dcdc86f5ac35d8112b0ff8693c4882e5f4d97.tar.gz dispatch-tracker-380dcdc86f5ac35d8112b0ff8693c4882e5f4d97.tar.xz | |
Add in delivered to to the filename on download
| -rw-r--r-- | app/dispatch/misc.py | 3 | ||||
| -rw-r--r-- | app/dispatch/views.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/dispatch/misc.py b/app/dispatch/misc.py index c1d100a..d876cfd 100644 --- a/app/dispatch/misc.py +++ b/app/dispatch/misc.py @@ -64,7 +64,8 @@ def zip_attachments_for_loads(loads, pre_append, date): ext = '.pdf' # Get the name for the zip file - zipname = l.description + '-' + l.user.identity.name + ext + zipname = l.description + ' - ' + l.delivered_to + ' - ' + \ + l.user.identity.name + ext zipname = get_valid_filename(zipname) z.write(p.document.path, zipname) diff --git a/app/dispatch/views.py b/app/dispatch/views.py index 1042d67..2aa82f5 100644 --- a/app/dispatch/views.py +++ b/app/dispatch/views.py @@ -473,7 +473,8 @@ def PaperworkDownload(request, load_id, pk): print(e) ext = '.pdf' - filename = get_valid_filename(load.description + ext) + filename = get_valid_filename(load.description + " - " + \ + load.delivered_to + ext) response = HttpResponse( fh.read(), |
