fix(core): Ensure that when creating a ticket an organization is specified
ref: #248 #378
This commit is contained in:
@ -214,11 +214,24 @@ class TicketModelSerializer(TicketBaseSerializer):
|
|||||||
|
|
||||||
is_valid = False
|
is_valid = False
|
||||||
|
|
||||||
centurion_exception.ValidationError(
|
raise centurion_exception.ValidationError(
|
||||||
detail = 'cant edit field: organization',
|
detail = 'cant edit field: organization',
|
||||||
code = 'cant_edit_field_organization',
|
code = 'cant_edit_field_organization',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
elif self.instance is None:
|
||||||
|
|
||||||
|
if 'organization' not in self.initial_data:
|
||||||
|
|
||||||
|
is_valid = False
|
||||||
|
|
||||||
|
raise centurion_exception.ValidationError(
|
||||||
|
detail = {
|
||||||
|
'organization': 'this field is required'
|
||||||
|
},
|
||||||
|
code = 'required',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
return is_valid
|
return is_valid
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user