Skip to content

Commit f75d5fd

Browse files
authored
Merge pull request #124 from PiotrIw/fix_issues
v1.5.58 - fix issues
2 parents 6c7c2dc + 1af2059 commit f75d5fd

File tree

6 files changed

+47
-6
lines changed

6 files changed

+47
-6
lines changed

config/settings/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,11 +464,12 @@
464464

465465
TINYMCE_DEFAULT_CONFIG = {
466466
"theme": "silver",
467+
"promotion": False,
467468
# "height": 500,
468469
"menubar": True,
469470
"lineheight": 1,
470-
"plugins": "autolink,lists,link,image,charmap,print,preview,anchor,"
471-
"searchreplace,visualblocks,code,fullscreen,insertdatetime,media,table,paste,"
471+
"plugins": "autolink,lists,link,image,charmap,preview,anchor,"
472+
"searchreplace,visualblocks,code,fullscreen,insertdatetime,media,table,"
472473
"code,help,wordcount",
473474
"toolbar": "undo redo | formatselect | lineheight | fontsizeselect |"
474475
"bold italic backcolor | alignleft aligncenter "

feder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# PEP 396: The __version__ attribute's value SHOULD be a string.
2-
__version__ = "1.5.57.deps"
2+
__version__ = "1.5.58"
33

44

55
# Compatibility to eg. django-rest-framework
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 5.2.10 on 2026-01-12 13:12
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('letters', '0044_alter_attachment_options_attachment_created_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='attachment',
15+
options={'verbose_name': 'Attachment', 'verbose_name_plural': 'Attachments'},
16+
),
17+
migrations.AlterField(
18+
model_name='attachment',
19+
name='attachment',
20+
field=models.FileField(max_length=500, upload_to='letters/%Y/%m/%d', verbose_name='File'),
21+
),
22+
]

feder/letters/models.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import logging
55
import uuid
66
from email.utils import getaddresses
7+
from os.path import basename
78

89
import requests
9-
from atom.models import AttachmentBase
1010
from django.conf import settings
1111
from django.contrib.auth import get_user_model
1212
from django.contrib.contenttypes.fields import GenericRelation
@@ -774,7 +774,10 @@ def with_scan_result(self):
774774
return self.prefetch_related("scan_request")
775775

776776

777-
class Attachment(TimeStampedModel, AttachmentBase):
777+
class Attachment(TimeStampedModel):
778+
attachment = models.FileField(
779+
upload_to="letters/%Y/%m/%d", verbose_name=_("File"), max_length=500
780+
)
778781
letter = models.ForeignKey(Letter, on_delete=models.CASCADE)
779782
objects = AttachmentQuerySet.as_manager()
780783
scan_request = GenericRelation(ScanRequest, verbose_name=_("Virus scan request"))
@@ -785,6 +788,14 @@ class Attachment(TimeStampedModel, AttachmentBase):
785788
verbose_name=_("Text content update result"), blank=True, null=True
786789
)
787790

791+
class Meta:
792+
verbose_name = _("Attachment")
793+
verbose_name_plural = _("Attachments")
794+
795+
@property
796+
def filename(self):
797+
return basename(self.attachment.name)
798+
788799
def current_scan_request(self):
789800
scans = self.scan_request.all()
790801
if scans:

feder/letters/views.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,11 @@ def post(self, request):
749749
def get_letter(self, headers, eml_manifest, text, eml_data, **kwargs):
750750
case = self.get_case(headers["to+"])
751751
eml_file = self.get_eml_file(eml_manifest, eml_data)
752-
from_email = headers["from"][0] if headers["from"][0] else "unknown@domain.gov"
752+
from_email = (
753+
headers["from"][0]
754+
if headers["from"] and headers["from"][0]
755+
else "unknown@domain.gov"
756+
)
753757

754758
auto_reply = headers.get("auto_reply_type")
755759
if auto_reply is not None:

feder/main/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@
7777
if "rosetta" in settings.INSTALLED_APPS:
7878
urlpatterns += [path("rosetta/", include("rosetta.urls"))]
7979

80+
if "tinymce" in settings.INSTALLED_APPS:
81+
urlpatterns += [path("tinymce/", include("tinymce.urls"))]
82+
8083
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
8184

8285
sitemaps = {

0 commit comments

Comments
 (0)