misc: send mail post date in submission context (#10459)
This commit is contained in:
parent
5febf9d8dc
commit
e8bf6cbcee
|
@ -36,10 +36,10 @@ class Association(models.Model):
|
|||
context = {}
|
||||
if self.source.contact_id:
|
||||
context['user_id'] = self.source.contact_id
|
||||
context['channel'] = self.source._meta.app_label
|
||||
context['summary_url'] = request.build_absolute_uri(
|
||||
reverse('wcs-summary', kwargs={'source_type': self.source_type_id,
|
||||
'source_pk': self.source_pk}))
|
||||
context.update(self.source.get_source_context(request))
|
||||
self.formdata_id = push_wcs_formdata(request, self.formdef_reference, context)
|
||||
self.save()
|
||||
|
||||
|
|
|
@ -95,6 +95,12 @@ class Mail(models.Model):
|
|||
return '-'
|
||||
return categories.keys()
|
||||
|
||||
def get_source_context(self, request):
|
||||
return {
|
||||
'channel': 'mail',
|
||||
'post_date': self.post_date and self.post_date.strftime('%Y-%m-%d'),
|
||||
}
|
||||
|
||||
|
||||
@receiver(post_save, sender=Mail)
|
||||
def create_thumbnail(sender, instance, created, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue