@@ 36-45 (lines=10) @@ | ||
33 | from omaha_server.utils import storage_with_spaces_instance |
|
34 | from crash.managers import CrashManager, SymbolsManager |
|
35 | ||
36 | ||
37 | def upload_to(directory, obj, filename): |
|
38 | now = timezone.now() |
|
39 | max_length = 255 |
|
40 | path = os.path.join(*map(str, [directory, now.year, now.month, |
|
41 | now.day, uuid.uuid4(), filename])) |
|
42 | if len(path) > max_length: |
|
43 | name, ext = os.path.splitext(path) |
|
44 | ext_length = len(ext) |
|
45 | path = name[:max_length-ext_length] + ext |
|
46 | return path |
|
47 | ||
48 |
@@ 35-44 (lines=10) @@ | ||
32 | from feedback.managers import FeedbackManager |
|
33 | ||
34 | ||
35 | def upload_to(directory, obj, filename): |
|
36 | now = timezone.now() |
|
37 | max_length = 100 |
|
38 | path = os.path.join(*map(str, [directory, now.year, now.month, |
|
39 | now.day, uuid.uuid4(), filename])) |
|
40 | if len(path) > max_length: |
|
41 | name, ext = os.path.splitext(path) |
|
42 | ext_length = len(ext) |
|
43 | path = name[:max_length-ext_length] + ext |
|
44 | return path |
|
45 | ||
46 | ||
47 | def screenshot_upload_to(obj, filename): |