mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-25 01:13:31 +01:00
Merge branch 'master' of https://github.com/rossp/django-helpdesk
This commit is contained in:
commit
a9f073cc48
@ -406,6 +406,9 @@ class PublicTicketForm(CustomFieldMixin, forms.Form):
|
||||
due_date = self.cleaned_data['due_date'],
|
||||
)
|
||||
|
||||
if q.default_owner and not t.assigned_to:
|
||||
t.assigned_to = q.default_owner
|
||||
|
||||
t.save()
|
||||
|
||||
for field, value in self.cleaned_data.items():
|
||||
@ -460,6 +463,17 @@ class PublicTicketForm(CustomFieldMixin, forms.Form):
|
||||
)
|
||||
messages_sent_to.append(t.submitter_email)
|
||||
|
||||
if t.assigned_to and t.assigned_to.usersettings.settings.get('email_on_ticket_assign', False) and t.assigned_to.email and t.assigned_to.email not in messages_sent_to:
|
||||
send_templated_mail(
|
||||
'assigned_owner',
|
||||
context,
|
||||
recipients=t.assigned_to.email,
|
||||
sender=q.from_address,
|
||||
fail_silently=True,
|
||||
files=files,
|
||||
)
|
||||
messages_sent_to.append(t.assigned_to.email)
|
||||
|
||||
if q.new_ticket_cc and q.new_ticket_cc not in messages_sent_to:
|
||||
send_templated_mail(
|
||||
'newticket_cc',
|
||||
|
23
helpdesk/migrations/0012_queue_default_owner.py
Normal file
23
helpdesk/migrations/0012_queue_default_owner.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.2 on 2016-02-15 21:37
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('helpdesk', '0011_admin_related_improvements'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='queue',
|
||||
name='default_owner',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='default_owner', to=settings.AUTH_USER_MODEL, verbose_name='Default owner'),
|
||||
),
|
||||
]
|
@ -223,6 +223,14 @@ class Queue(models.Model):
|
||||
help_text=_('Socks proxy port number. Default: 9150 (default TOR port)'),
|
||||
)
|
||||
|
||||
default_owner = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
related_name='default_owner',
|
||||
blank=True,
|
||||
null=True,
|
||||
verbose_name=_('Default owner'),
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return "%s" % self.title
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user