mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-13 18:31:10 +01:00
Issue #88: Allow users to set an option to define whether their e-mail
address is used as the default submitter e-mail when they submit tickets. Thanks to Andreas Kotowicz for this suggestion.
This commit is contained in:
parent
da703f3c83
commit
76f8d416c0
6
forms.py
6
forms.py
@ -337,6 +337,12 @@ class UserSettingsForm(forms.Form):
|
|||||||
max_value=1000,
|
max_value=1000,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
use_email_as_submitter = forms.BooleanField(
|
||||||
|
label=_('Use my e-mail address when submitting tickets?'),
|
||||||
|
help_text=_('When you submit a ticket, do you want to automatically use your e-mail address as the submitter address? You can type a different e-mail address when entering the ticket if needed, this option only changes the default.'),
|
||||||
|
required=False,
|
||||||
|
)
|
||||||
|
|
||||||
class EmailIgnoreForm(forms.ModelForm):
|
class EmailIgnoreForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = IgnoreEmail
|
model = IgnoreEmail
|
||||||
|
@ -564,7 +564,11 @@ def create_ticket(request):
|
|||||||
ticket = form.save(user=request.user)
|
ticket = form.save(user=request.user)
|
||||||
return HttpResponseRedirect(ticket.get_absolute_url())
|
return HttpResponseRedirect(ticket.get_absolute_url())
|
||||||
else:
|
else:
|
||||||
form = TicketForm()
|
initial_data = {}
|
||||||
|
if request.user.usersettings.settings.get('use_email_as_submitter', False) and request.user.email:
|
||||||
|
initial_data['submitter_email'] = request.user.email
|
||||||
|
|
||||||
|
form = TicketForm(initial=initial_data)
|
||||||
form.fields['queue'].choices = [('', '--------')] + [[q.id, q.title] for q in Queue.objects.all()]
|
form.fields['queue'].choices = [('', '--------')] + [[q.id, q.title] for q in Queue.objects.all()]
|
||||||
form.fields['assigned_to'].choices = [('', '--------')] + [[u.id, u.username] for u in User.objects.filter(is_active=True)]
|
form.fields['assigned_to'].choices = [('', '--------')] + [[u.id, u.username] for u in User.objects.filter(is_active=True)]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user