diff options
| author | Magnus Hagander | 2022-11-05 17:48:26 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2022-11-05 17:48:26 +0000 |
| commit | ce4578aed230407ae93fb09a87fe8a61e9995041 (patch) | |
| tree | 52ac4a1564d8510ca440f474b436e43cffb2878d /postgresqleu/adyen | |
| parent | 523998b865d01a97a89f6a6efeab3a7c40e0a0ee (diff) | |
Remove hardcoded values for Adyen merchant accounts
Replace them with an (inefficient) query, for the unusual cases where it
has to be checked in the django admin interface.
Diffstat (limited to 'postgresqleu/adyen')
| -rw-r--r-- | postgresqleu/adyen/admin.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/postgresqleu/adyen/admin.py b/postgresqleu/adyen/admin.py index b0523712..430ab217 100644 --- a/postgresqleu/adyen/admin.py +++ b/postgresqleu/adyen/admin.py @@ -36,7 +36,8 @@ class MerchantAccountFilter(admin.SimpleListFilter): parameter_name = 'merchantaccount' def lookups(self, request, model_admin): - return (('PostgreSqlEUCOM', 'PostgreSqlEUCOM'), ('PostgreSqlEUPOS', 'PostgreSqlEUPOS'), ) + # This is painfully inefficient, but it's called infrequently, so meh. + return [(c['merchantAccountCode'], c['merchantAccountCode']) for c in Notification.objects.values('merchantAccountCode').distinct()] def queryset(self, request, queryset): if self.value(): |
