mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-06-03 08:25:41 +02:00
Fix hidden field query args
This commit is contained in:
parent
b708b786d4
commit
a9e5cfa52d
@ -421,20 +421,22 @@ class PublicTicketForm(AbstractTicketForm):
|
|||||||
super(PublicTicketForm, self).__init__(*args, **kwargs)
|
super(PublicTicketForm, self).__init__(*args, **kwargs)
|
||||||
self._add_form_custom_fields(False)
|
self._add_form_custom_fields(False)
|
||||||
|
|
||||||
field_hide_table = {
|
for field in self.fields.keys():
|
||||||
|
if field in hidden_fields:
|
||||||
|
self.fields[field].widget = forms.HiddenInput()
|
||||||
|
if field in readonly_fields:
|
||||||
|
self.fields[field].disabled = True
|
||||||
|
|
||||||
|
field_deletion_table = {
|
||||||
'queue': 'HELPDESK_PUBLIC_TICKET_QUEUE',
|
'queue': 'HELPDESK_PUBLIC_TICKET_QUEUE',
|
||||||
'priority': 'HELPDESK_PUBLIC_TICKET_PRIORITY',
|
'priority': 'HELPDESK_PUBLIC_TICKET_PRIORITY',
|
||||||
'due_date': 'HELPDESK_PUBLIC_TICKET_DUE_DATE',
|
'due_date': 'HELPDESK_PUBLIC_TICKET_DUE_DATE',
|
||||||
}
|
}
|
||||||
|
|
||||||
for field_name, field_setting_key in field_hide_table.items():
|
for field_name, field_setting_key in field_deletion_table.items():
|
||||||
has_settings_default_value = getattr(settings, field_setting_key, None)
|
has_settings_default_value = getattr(settings, field_setting_key, None)
|
||||||
if has_settings_default_value is not None:
|
if has_settings_default_value is not None:
|
||||||
hidden_fields += (field_name,)
|
del self.fields[field_name]
|
||||||
|
|
||||||
for field in hidden_fields:
|
|
||||||
if field in self.fields:
|
|
||||||
del self.fields[field]
|
|
||||||
|
|
||||||
public_queues = Queue.objects.filter(allow_public_submission=True)
|
public_queues = Queue.objects.filter(allow_public_submission=True)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user