From 291d7e404e12e1d017403242f8ed199046f0904c Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Thu, 17 Nov 2022 19:21:00 -0700 Subject: Logged out experience, config, and profiles --- activities/models/post_attachment.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activities/models') diff --git a/activities/models/post_attachment.py b/activities/models/post_attachment.py index ee77d29..6ccea08 100644 --- a/activities/models/post_attachment.py +++ b/activities/models/post_attachment.py @@ -1,5 +1,8 @@ +from functools import partial + from django.db import models +from core.uploads import upload_namer from stator.models import State, StateField, StateGraph, StatorModel @@ -31,7 +34,9 @@ class PostAttachment(StatorModel): mimetype = models.CharField(max_length=200) # File may not be populated if it's remote and not cached on our side yet - file = models.FileField(upload_to="attachments/%Y/%m/%d/", null=True, blank=True) + file = models.FileField( + upload_to=partial(upload_namer, "attachments"), null=True, blank=True + ) remote_url = models.CharField(max_length=500, null=True, blank=True) -- cgit v1.2.3