Commit a9f1089
committed
[FIX] helpdesk_mgmt: Don't fail on category not required
Steps to reproduce:
- Go to Helpdesk > Configuration > Settings.
- Uncheck "Required Category" and save.
- Go to portal page (/my) and click on "New Ticket".
- Fill all the required data except "Category".
- Press on "Submit Ticket".
An error will raise:
```
File "./helpdesk_mgmt/controllers/main.py", line 106, in submit_ticket
vals = self._prepare_submit_ticket_vals(**kw)
File "./helpdesk_custom_esment/controllers/main.py", line 41, in _prepare_submit_ticket_vals
vals = super()._prepare_submit_ticket_vals(**kw)
File "./helpdesk_mgmt_timesheet/controllers/main.py", line 11, in _prepare_submit_ticket_vals
vals = super(CustomHelpdeskTicketController, self)._prepare_submit_ticket_vals(
File "./helpdesk_mgmt/controllers/main.py", line 73, in _prepare_submit_ticket_vals
int(kw.get("category", 0))
ValueError: invalid literal for int() with base 10: ''
```
As there's no value set there. The solution is to make the code
resilient for empty values in that field.
TT566561 parent 5029eea commit a9f1089
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments