Bug 1564917 - Use default value when there are no conditions; r=jgraham

Differential Revision: https://phabricator.services.mozilla.com/D37871

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Maja Frydrychowicz 2019-07-12 14:47:39 +00:00
Родитель fb7e73ed08
Коммит 6426ddb4af
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -411,7 +411,9 @@ class PropertyUpdate(object):
# If all the values match remove all conditionals
# This handles the case where we update a number of existing conditions and they
# all end up looking like the post-update default.
new_default = conditions[-1][1] if conditions[-1][0] is None else self.default_value
new_default = self.default_value
if conditions and conditions[-1][0] is None:
new_default = conditions[-1][1]
if all(condition[1] == new_default for condition in conditions):
conditions = [(None, new_default)]