Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BCerki committed Jan 17, 2025
1 parent 5c367c5 commit 5af0462
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 5 additions & 3 deletions bc_obps/service/operation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ def list_operations(
base_qs = OperationDataAccessService.get_all_operations_for_user(user)
list_of_filters = [
Q(bcghg_id__id__icontains=bcghg_id) if bcghg_id else Q(),
Q(bc_obps_regulated_operation__id__icontains=bc_obps_regulated_operation)
if bc_obps_regulated_operation
else Q(),
(
Q(bc_obps_regulated_operation__id__icontains=bc_obps_regulated_operation)
if bc_obps_regulated_operation
else Q()
),
Q(name__icontains=name) if name else Q(),
Q(operator__legal_name__icontains=operator) if operator else Q(),
Q(status__icontains=status) if status else Q(),
Expand Down
5 changes: 3 additions & 2 deletions bc_obps/service/tests/test_operation_service_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def test_update_operation_archive_multiple_operators():
@staticmethod
def test_update_operation_with_operation_representatives_with_address():
approved_user_operator = baker.make_recipe('utils.approved_user_operator')
existing_operation = baker.make_recipe('utils.operation')
existing_operation = baker.make_recipe('utils.operation', operator=approved_user_operator.operator)
contacts = baker.make_recipe(
'utils.contact', business_role=BusinessRole.objects.get(role_name='Operation Representative'), _quantity=3
)
Expand All @@ -640,6 +640,7 @@ def test_update_operation_with_operation_representatives_with_address():
boundary_map=MOCK_DATA_URL,
operation_representatives=[contact.id for contact in contacts],
)

operation = OperationServiceV2.create_or_update_operation_v2(
approved_user_operator.user.user_guid,
payload,
Expand All @@ -654,7 +655,7 @@ def test_update_operation_with_operation_representatives_with_address():
@staticmethod
def test_update_operation_with_operation_representative_without_address():
approved_user_operator = baker.make_recipe('utils.approved_user_operator')
existing_operation = baker.make_recipe('utils.operation')
existing_operation = baker.make_recipe('utils.operation', operator=approved_user_operator.operator)
# create contacts with incomplete address data
contacts = baker.make_recipe(
'utils.contact', business_role=BusinessRole.objects.get(role_name='Operation Representative'), _quantity=5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const OperationInformationForm = ({
const handleSubmit = async (data: {
formData?: OperationInformationFormData;
}) => {
setError(undefined);
const response = await actionHandler(
`registration/operations/${operationId}`,
"PUT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export const createAdministrationRegistrationInformationSchema = async (
// fetch db values that are dropdown options
const regulatedProducts: { id: number; name: string }[] =
await getRegulatedProducts();
const contacts: { id: number; first_name: string; last_name: string }[] =
await getContacts();
const contacts: {
items: [{ id: number; first_name: string; last_name: string }];
} = await getContacts();
const isRegulatedProducts =
registrationPurposeValue ===
RegistrationPurposes.OBPS_REGULATED_OPERATION.valueOf();
Expand Down Expand Up @@ -131,7 +132,6 @@ export const registrationInformationUiSchema: UiSchema = {
"new_entrant_application",
],
"ui:FieldTemplate": SectionFieldTemplate,
// brianna why doesn't error show, looks exactly the same as regulated_products
operation_representatives: {
"ui:widget": "MultiSelectWidget",
},
Expand Down

0 comments on commit 5af0462

Please sign in to comment.