Skip to content

Commit 73193a4

Browse files
authored
Merge pull request #341 from jroneel/mailing-outs
Mailing outs
2 parents 907d11f + 6b33372 commit 73193a4

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

massmail/site/mailingoutadmin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class MailingOutAdmin(CrmModelAdmin):
6363

6464
# -- ModelAdmin methods -- #
6565

66+
def has_add_permission(self, request):
67+
return False # Completely disable adding Mailing Outs
68+
6669
def changelist_view(self, request, extra_context=None):
6770
extra_context = extra_context or {}
6871
now = timezone.localtime(timezone.now())

tests/main_menu_data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,9 +792,9 @@ def get_task_app_data(add_models: tuple = tuple(), prefix: str = '') -> dict:
792792
{
793793
'name': 'Mailing Outs',
794794
'object_name': 'MailingOut',
795-
'perms': get_perms(),
795+
'perms': get_perms(add=False),
796796
'admin_url': f'/en/{PREFIX}massmail/mailingout/',
797-
'add_url': f'/en/{PREFIX}massmail/mailingout/add/',
797+
'add_url': None,
798798
'view_only': False
799799
},
800800
{
@@ -1149,9 +1149,9 @@ def get_task_app_data(add_models: tuple = tuple(), prefix: str = '') -> dict:
11491149
{
11501150
'name': 'Mailing Outs',
11511151
'object_name': 'MailingOut',
1152-
'perms': get_perms(),
1152+
'perms': get_perms(add=False),
11531153
'admin_url': f'/en/{ADMIN_PREFIX}massmail/mailingout/',
1154-
'add_url': f'/en/{ADMIN_PREFIX}massmail/mailingout/add/',
1154+
'add_url': None,
11551155
'view_only': False
11561156
},
11571157
{

0 commit comments

Comments
 (0)