Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def submit(self):
if self.constraints_copy:
try:
parsed = set(parse_constraints(self.constraints_copy))
except ValueError:
return self.set_constraints_error()
has_valid_constraints = parsed.issubset(
{normalize_key(field) for field in consts.ALLOWED_CONSTRAINTS})
if not has_valid_constraints:
return self.set_constraints_error()
self.application.options = self.options_copy
self.application.num_units = self.num_units_copy
self.application.constraints = self.constraints_copy
# Replace application data with updated info
new_data = self.application.to_dict()
app.current_bundle['applications'][self.application.name] = new_data
self.prev_screen()