Skip to content

Commit

Permalink
Use dict.get to specify fallback value
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinRiese committed Dec 4, 2024
1 parent bd58982 commit fb1f4ba
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions corehq/messaging/scheduling/scheduling_partitioned/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,8 @@ def _passes_user_data_filter(self, contact):
else:
user_data = contact.get_user_data(self.domain)
for key, value_or_property_name in self.memoized_schedule.user_data_filter.items():
if key not in user_data:
actual_values_set = {""}
else:
actual_values_set = self.convert_to_set(user_data[key])

allowed_values_set = {self._get_filter_value(v) for v in self.convert_to_set(value_or_property_name)}
actual_values_set = self.convert_to_set(user_data.get(key, ""))

if actual_values_set.isdisjoint(allowed_values_set):
return False
Expand Down

0 comments on commit fb1f4ba

Please sign in to comment.