Workflow - on user input deluge function - issue with combining Boolean expressions

Workflow - on user input deluge function - issue with combining Boolean expressions

I want to fetch records from a Contacts form based on condition where Contact in a campus and Contact may be a 'Controller' or 'Both'.

I write the expression like this in the deluge editor. It updates it without any errors.
controllerList = Contacts[((Campus1 == input.Campus1) && (Contact_Type == "Controller" || Contact_Type == "Both"))].ID.getAll();

The issue if go back to the deluge editor later, it shows like this.
controllerList = Contacts[Campus1 == input.Campus1 && Contact_Type == "Controller" || Contact_Type == "Both"].ID.getAll();

The parenthesis are removed and the records are not fetched as expected. 

What is the right way to write this expression?