Allow to restrict payment methods by invoice address country

This commit is contained in:
Raphael Michel
2018-09-19 16:10:40 +02:00
parent 1155d18b7f
commit 06d9c48ed4
4 changed files with 101 additions and 6 deletions

View File

@@ -497,6 +497,9 @@ class ProviderForm(SettingsForm):
elif isinstance(v, (RelativeDateTimeField, RelativeDateField)):
v.set_event(self.obj)
if hasattr(v, '_as_type'):
self.initial[k] = self.obj.settings.get(k, as_type=v._as_type)
def clean(self):
cleaned_data = super().clean()
enabled = cleaned_data.get(self.settingspref + '_enabled')