We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Remove subscriber__email from search_fields
> DJSTRIPE_SUBSCRIBER_MODEL must have an email field. If your existing model has no email field, add an email property that defines an email address to use.

Since the `DJSTRIPE_SUBSCRIBER_MODEL` could have email as a property we probably shouldn't be assuming `subscriber__email` in admin `search_fields`.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `djstripe/admin.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 """
3 Note: Django 1.4 support was dropped in #107
4         https://github.com/pydanny/dj-stripe/pull/107
5 """
6 
7 from django.contrib import admin
8 
9 from .models import Event, EventProcessingException, Transfer, Charge, Plan
10 from .models import Invoice, InvoiceItem, CurrentSubscription, Customer
11 
12 
13 class CustomerHasCardListFilter(admin.SimpleListFilter):
14     title = "card presence"
15     parameter_name = "has_card"
16 
17     def lookups(self, request, model_admin):
18         return [
19             ["yes", "Has Card"],
20             ["no", "Does Not Have a Card"]
21         ]
22 
23     def queryset(self, request, queryset):
24         if self.value() == "yes":
25             return queryset.exclude(card_fingerprint="")
26         if self.value() == "no":
27             return queryset.filter(card_fingerprint="")
28 
29 
30 class InvoiceCustomerHasCardListFilter(admin.SimpleListFilter):
31     title = "card presence"
32     parameter_name = "has_card"
33 
34     def lookups(self, request, model_admin):
35         return [
36             ["yes", "Has Card"],
37             ["no", "Does Not Have a Card"]
38         ]
39 
40     def queryset(self, request, queryset):
41         if self.value() == "yes":
42             return queryset.exclude(customer__card_fingerprint="")
43         if self.value() == "no":
44             return queryset.filter(customer__card_fingerprint="")
45 
46 
47 class CustomerSubscriptionStatusListFilter(admin.SimpleListFilter):
48     title = "subscription status"
49     parameter_name = "sub_status"
50 
51     def lookups(self, request, model_admin):
52         statuses = [
53             [x, x.replace("_", " ").title()]
54             for x in CurrentSubscription.objects.all().values_list(
55                 "status",
56                 flat=True
57             ).distinct()
58         ]
59         statuses.append(["none", "No Subscription"])
60         return statuses
61 
62     def queryset(self, request, queryset):
63         if self.value() is None:
64             return queryset.all()
65         else:
66             return queryset.filter(current_subscription__status=self.value())
67 
68 
69 def send_charge_receipt(modeladmin, request, queryset):
70     """
71     Function for sending receipts from the admin if a receipt is not sent for
72     a specific charge.
73     """
74     for charge in queryset:
75         charge.send_receipt()
76 
77 
78 admin.site.register(
79     Charge,
80     readonly_fields=('created',),
81     list_display=[
82         "stripe_id",
83         "customer",
84         "amount",
85         "description",
86         "paid",
87         "disputed",
88         "refunded",
89         "fee",
90         "receipt_sent",
91         "created"
92     ],
93     search_fields=[
94         "stripe_id",
95         "customer__stripe_id",
96         "customer__subscriber__email",
97         "card_last_4",
98         "invoice__stripe_id"
99     ],
100     list_filter=[
101         "paid",
102         "disputed",
103         "refunded",
104         "card_kind",
105         "created"
106     ],
107     raw_id_fields=[
108         "customer",
109         "invoice"
110     ],
111     actions=(send_charge_receipt,),
112 )
113 
114 admin.site.register(
115     EventProcessingException,
116     readonly_fields=('created',),
117     list_display=[
118         "message",
119         "event",
120         "created"
121     ],
122     search_fields=[
123         "message",
124         "traceback",
125         "data"
126     ],
127 )
128 
129 admin.site.register(
130     Event,
131     raw_id_fields=["customer"],
132     readonly_fields=('created',),
133     list_display=[
134         "stripe_id",
135         "kind",
136         "livemode",
137         "valid",
138         "processed",
139         "created"
140     ],
141     list_filter=[
142         "kind",
143         "created",
144         "valid",
145         "processed"
146     ],
147     search_fields=[
148         "stripe_id",
149         "customer__stripe_id",
150         "customer__subscriber__email",
151         "validated_message"
152     ],
153 )
154 
155 
156 class CurrentSubscriptionInline(admin.TabularInline):
157     model = CurrentSubscription
158 
159 
160 def subscription_status(obj):
161     return obj.current_subscription.status
162 subscription_status.short_description = "Subscription Status"
163 
164 
165 admin.site.register(
166     Customer,
167     raw_id_fields=["subscriber"],
168     readonly_fields=('created',),
169     list_display=[
170         "stripe_id",
171         "subscriber",
172         "card_kind",
173         "card_last_4",
174         subscription_status,
175         "created"
176     ],
177     list_filter=[
178         "card_kind",
179         CustomerHasCardListFilter,
180         CustomerSubscriptionStatusListFilter
181     ],
182     search_fields=[
183         "stripe_id",
184         "subscriber__email"
185     ],
186     inlines=[CurrentSubscriptionInline]
187 )
188 
189 
190 class InvoiceItemInline(admin.TabularInline):
191     model = InvoiceItem
192 
193 
194 def customer_has_card(obj):
195     """ Returns True if the customer has a card attached to its account."""
196     return obj.customer.card_fingerprint != ""
197 customer_has_card.short_description = "Customer Has Card"
198 
199 
200 def customer_email(obj):
201     """ Returns a string representation of the customer's email."""
202     return str(obj.customer.subscriber.email)
203 customer_email.short_description = "Customer"
204 
205 
206 admin.site.register(
207     Invoice,
208     raw_id_fields=["customer"],
209     readonly_fields=('created',),
210     list_display=[
211         "stripe_id",
212         "paid",
213         "closed",
214         customer_email,
215         customer_has_card,
216         "period_start",
217         "period_end",
218         "subtotal",
219         "total",
220         "created"
221     ],
222     search_fields=[
223         "stripe_id",
224         "customer__stripe_id",
225         "customer__subscriber__email"
226     ],
227     list_filter=[
228         InvoiceCustomerHasCardListFilter,
229         "paid",
230         "closed",
231         "attempted",
232         "attempts",
233         "created",
234         "date",
235         "period_end",
236         "total"
237     ],
238     inlines=[InvoiceItemInline]
239 )
240 
241 
242 admin.site.register(
243     Transfer,
244     raw_id_fields=["event"],
245     readonly_fields=('created',),
246     list_display=[
247         "stripe_id",
248         "amount",
249         "status",
250         "date",
251         "description",
252         "created"
253     ],
254     search_fields=[
255         "stripe_id",
256         "event__stripe_id"
257     ]
258 )
259 
260 
261 class PlanAdmin(admin.ModelAdmin):
262 
263     def save_model(self, request, obj, form, change):
264         """Update or create objects using our custom methods that
265         sync with Stripe."""
266 
267         if change:
268             obj.update_name()
269 
270         else:
271             Plan.get_or_create(**form.cleaned_data)
272 
273     def get_readonly_fields(self, request, obj=None):
274         readonly_fields = list(self.readonly_fields)
275         if obj:
276             readonly_fields.extend([
277                 'stripe_id',
278                 'amount',
279                 'currency',
280                 'interval',
281                 'interval_count',
282                 'trial_period_days'])
283 
284         return readonly_fields
285 
286 admin.site.register(Plan, PlanAdmin)
287
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/djstripe/admin.py b/djstripe/admin.py
--- a/djstripe/admin.py
+++ b/djstripe/admin.py
@@ -93,7 +93,6 @@
     search_fields=[
         "stripe_id",
         "customer__stripe_id",
-        "customer__subscriber__email",
         "card_last_4",
         "invoice__stripe_id"
     ],
@@ -147,7 +146,6 @@
     search_fields=[
         "stripe_id",
         "customer__stripe_id",
-        "customer__subscriber__email",
         "validated_message"
     ],
 )
@@ -180,8 +178,7 @@
         CustomerSubscriptionStatusListFilter
     ],
     search_fields=[
-        "stripe_id",
-        "subscriber__email"
+        "stripe_id"
     ],
     inlines=[CurrentSubscriptionInline]
 )
@@ -221,8 +218,7 @@
     ],
     search_fields=[
         "stripe_id",
-        "customer__stripe_id",
-        "customer__subscriber__email"
+        "customer__stripe_id"
     ],
     list_filter=[
         InvoiceCustomerHasCardListFilter,

{"golden_diff": "diff --git a/djstripe/admin.py b/djstripe/admin.py\n--- a/djstripe/admin.py\n+++ b/djstripe/admin.py\n@@ -93,7 +93,6 @@\n     search_fields=[\n         \"stripe_id\",\n         \"customer__stripe_id\",\n-        \"customer__subscriber__email\",\n         \"card_last_4\",\n         \"invoice__stripe_id\"\n     ],\n@@ -147,7 +146,6 @@\n     search_fields=[\n         \"stripe_id\",\n         \"customer__stripe_id\",\n-        \"customer__subscriber__email\",\n         \"validated_message\"\n     ],\n )\n@@ -180,8 +178,7 @@\n         CustomerSubscriptionStatusListFilter\n     ],\n     search_fields=[\n-        \"stripe_id\",\n-        \"subscriber__email\"\n+        \"stripe_id\"\n     ],\n     inlines=[CurrentSubscriptionInline]\n )\n@@ -221,8 +218,7 @@\n     ],\n     search_fields=[\n         \"stripe_id\",\n-        \"customer__stripe_id\",\n-        \"customer__subscriber__email\"\n+        \"customer__stripe_id\"\n     ],\n     list_filter=[\n         InvoiceCustomerHasCardListFilter,\n", "issue": "Remove subscriber__email from search_fields\n> DJSTRIPE_SUBSCRIBER_MODEL must have an email field. If your existing model has no email field, add an email property that defines an email address to use.\n\nSince the `DJSTRIPE_SUBSCRIBER_MODEL` could have email as a property we probably shouldn't be assuming `subscriber__email` in admin `search_fields`.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nNote: Django 1.4 support was dropped in #107\n        https://github.com/pydanny/dj-stripe/pull/107\n\"\"\"\n\nfrom django.contrib import admin\n\nfrom .models import Event, EventProcessingException, Transfer, Charge, Plan\nfrom .models import Invoice, InvoiceItem, CurrentSubscription, Customer\n\n\nclass CustomerHasCardListFilter(admin.SimpleListFilter):\n    title = \"card presence\"\n    parameter_name = \"has_card\"\n\n    def lookups(self, request, model_admin):\n        return [\n            [\"yes\", \"Has Card\"],\n            [\"no\", \"Does Not Have a Card\"]\n        ]\n\n    def queryset(self, request, queryset):\n        if self.value() == \"yes\":\n            return queryset.exclude(card_fingerprint=\"\")\n        if self.value() == \"no\":\n            return queryset.filter(card_fingerprint=\"\")\n\n\nclass InvoiceCustomerHasCardListFilter(admin.SimpleListFilter):\n    title = \"card presence\"\n    parameter_name = \"has_card\"\n\n    def lookups(self, request, model_admin):\n        return [\n            [\"yes\", \"Has Card\"],\n            [\"no\", \"Does Not Have a Card\"]\n        ]\n\n    def queryset(self, request, queryset):\n        if self.value() == \"yes\":\n            return queryset.exclude(customer__card_fingerprint=\"\")\n        if self.value() == \"no\":\n            return queryset.filter(customer__card_fingerprint=\"\")\n\n\nclass CustomerSubscriptionStatusListFilter(admin.SimpleListFilter):\n    title = \"subscription status\"\n    parameter_name = \"sub_status\"\n\n    def lookups(self, request, model_admin):\n        statuses = [\n            [x, x.replace(\"_\", \" \").title()]\n            for x in CurrentSubscription.objects.all().values_list(\n                \"status\",\n                flat=True\n            ).distinct()\n        ]\n        statuses.append([\"none\", \"No Subscription\"])\n        return statuses\n\n    def queryset(self, request, queryset):\n        if self.value() is None:\n            return queryset.all()\n        else:\n            return queryset.filter(current_subscription__status=self.value())\n\n\ndef send_charge_receipt(modeladmin, request, queryset):\n    \"\"\"\n    Function for sending receipts from the admin if a receipt is not sent for\n    a specific charge.\n    \"\"\"\n    for charge in queryset:\n        charge.send_receipt()\n\n\nadmin.site.register(\n    Charge,\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"customer\",\n        \"amount\",\n        \"description\",\n        \"paid\",\n        \"disputed\",\n        \"refunded\",\n        \"fee\",\n        \"receipt_sent\",\n        \"created\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"customer__stripe_id\",\n        \"customer__subscriber__email\",\n        \"card_last_4\",\n        \"invoice__stripe_id\"\n    ],\n    list_filter=[\n        \"paid\",\n        \"disputed\",\n        \"refunded\",\n        \"card_kind\",\n        \"created\"\n    ],\n    raw_id_fields=[\n        \"customer\",\n        \"invoice\"\n    ],\n    actions=(send_charge_receipt,),\n)\n\nadmin.site.register(\n    EventProcessingException,\n    readonly_fields=('created',),\n    list_display=[\n        \"message\",\n        \"event\",\n        \"created\"\n    ],\n    search_fields=[\n        \"message\",\n        \"traceback\",\n        \"data\"\n    ],\n)\n\nadmin.site.register(\n    Event,\n    raw_id_fields=[\"customer\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"kind\",\n        \"livemode\",\n        \"valid\",\n        \"processed\",\n        \"created\"\n    ],\n    list_filter=[\n        \"kind\",\n        \"created\",\n        \"valid\",\n        \"processed\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"customer__stripe_id\",\n        \"customer__subscriber__email\",\n        \"validated_message\"\n    ],\n)\n\n\nclass CurrentSubscriptionInline(admin.TabularInline):\n    model = CurrentSubscription\n\n\ndef subscription_status(obj):\n    return obj.current_subscription.status\nsubscription_status.short_description = \"Subscription Status\"\n\n\nadmin.site.register(\n    Customer,\n    raw_id_fields=[\"subscriber\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"subscriber\",\n        \"card_kind\",\n        \"card_last_4\",\n        subscription_status,\n        \"created\"\n    ],\n    list_filter=[\n        \"card_kind\",\n        CustomerHasCardListFilter,\n        CustomerSubscriptionStatusListFilter\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"subscriber__email\"\n    ],\n    inlines=[CurrentSubscriptionInline]\n)\n\n\nclass InvoiceItemInline(admin.TabularInline):\n    model = InvoiceItem\n\n\ndef customer_has_card(obj):\n    \"\"\" Returns True if the customer has a card attached to its account.\"\"\"\n    return obj.customer.card_fingerprint != \"\"\ncustomer_has_card.short_description = \"Customer Has Card\"\n\n\ndef customer_email(obj):\n    \"\"\" Returns a string representation of the customer's email.\"\"\"\n    return str(obj.customer.subscriber.email)\ncustomer_email.short_description = \"Customer\"\n\n\nadmin.site.register(\n    Invoice,\n    raw_id_fields=[\"customer\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"paid\",\n        \"closed\",\n        customer_email,\n        customer_has_card,\n        \"period_start\",\n        \"period_end\",\n        \"subtotal\",\n        \"total\",\n        \"created\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"customer__stripe_id\",\n        \"customer__subscriber__email\"\n    ],\n    list_filter=[\n        InvoiceCustomerHasCardListFilter,\n        \"paid\",\n        \"closed\",\n        \"attempted\",\n        \"attempts\",\n        \"created\",\n        \"date\",\n        \"period_end\",\n        \"total\"\n    ],\n    inlines=[InvoiceItemInline]\n)\n\n\nadmin.site.register(\n    Transfer,\n    raw_id_fields=[\"event\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"amount\",\n        \"status\",\n        \"date\",\n        \"description\",\n        \"created\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"event__stripe_id\"\n    ]\n)\n\n\nclass PlanAdmin(admin.ModelAdmin):\n\n    def save_model(self, request, obj, form, change):\n        \"\"\"Update or create objects using our custom methods that\n        sync with Stripe.\"\"\"\n\n        if change:\n            obj.update_name()\n\n        else:\n            Plan.get_or_create(**form.cleaned_data)\n\n    def get_readonly_fields(self, request, obj=None):\n        readonly_fields = list(self.readonly_fields)\n        if obj:\n            readonly_fields.extend([\n                'stripe_id',\n                'amount',\n                'currency',\n                'interval',\n                'interval_count',\n                'trial_period_days'])\n\n        return readonly_fields\n\nadmin.site.register(Plan, PlanAdmin)\n", "path": "djstripe/admin.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nNote: Django 1.4 support was dropped in #107\n        https://github.com/pydanny/dj-stripe/pull/107\n\"\"\"\n\nfrom django.contrib import admin\n\nfrom .models import Event, EventProcessingException, Transfer, Charge, Plan\nfrom .models import Invoice, InvoiceItem, CurrentSubscription, Customer\n\n\nclass CustomerHasCardListFilter(admin.SimpleListFilter):\n    title = \"card presence\"\n    parameter_name = \"has_card\"\n\n    def lookups(self, request, model_admin):\n        return [\n            [\"yes\", \"Has Card\"],\n            [\"no\", \"Does Not Have a Card\"]\n        ]\n\n    def queryset(self, request, queryset):\n        if self.value() == \"yes\":\n            return queryset.exclude(card_fingerprint=\"\")\n        if self.value() == \"no\":\n            return queryset.filter(card_fingerprint=\"\")\n\n\nclass InvoiceCustomerHasCardListFilter(admin.SimpleListFilter):\n    title = \"card presence\"\n    parameter_name = \"has_card\"\n\n    def lookups(self, request, model_admin):\n        return [\n            [\"yes\", \"Has Card\"],\n            [\"no\", \"Does Not Have a Card\"]\n        ]\n\n    def queryset(self, request, queryset):\n        if self.value() == \"yes\":\n            return queryset.exclude(customer__card_fingerprint=\"\")\n        if self.value() == \"no\":\n            return queryset.filter(customer__card_fingerprint=\"\")\n\n\nclass CustomerSubscriptionStatusListFilter(admin.SimpleListFilter):\n    title = \"subscription status\"\n    parameter_name = \"sub_status\"\n\n    def lookups(self, request, model_admin):\n        statuses = [\n            [x, x.replace(\"_\", \" \").title()]\n            for x in CurrentSubscription.objects.all().values_list(\n                \"status\",\n                flat=True\n            ).distinct()\n        ]\n        statuses.append([\"none\", \"No Subscription\"])\n        return statuses\n\n    def queryset(self, request, queryset):\n        if self.value() is None:\n            return queryset.all()\n        else:\n            return queryset.filter(current_subscription__status=self.value())\n\n\ndef send_charge_receipt(modeladmin, request, queryset):\n    \"\"\"\n    Function for sending receipts from the admin if a receipt is not sent for\n    a specific charge.\n    \"\"\"\n    for charge in queryset:\n        charge.send_receipt()\n\n\nadmin.site.register(\n    Charge,\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"customer\",\n        \"amount\",\n        \"description\",\n        \"paid\",\n        \"disputed\",\n        \"refunded\",\n        \"fee\",\n        \"receipt_sent\",\n        \"created\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"customer__stripe_id\",\n        \"card_last_4\",\n        \"invoice__stripe_id\"\n    ],\n    list_filter=[\n        \"paid\",\n        \"disputed\",\n        \"refunded\",\n        \"card_kind\",\n        \"created\"\n    ],\n    raw_id_fields=[\n        \"customer\",\n        \"invoice\"\n    ],\n    actions=(send_charge_receipt,),\n)\n\nadmin.site.register(\n    EventProcessingException,\n    readonly_fields=('created',),\n    list_display=[\n        \"message\",\n        \"event\",\n        \"created\"\n    ],\n    search_fields=[\n        \"message\",\n        \"traceback\",\n        \"data\"\n    ],\n)\n\nadmin.site.register(\n    Event,\n    raw_id_fields=[\"customer\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"kind\",\n        \"livemode\",\n        \"valid\",\n        \"processed\",\n        \"created\"\n    ],\n    list_filter=[\n        \"kind\",\n        \"created\",\n        \"valid\",\n        \"processed\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"customer__stripe_id\",\n        \"validated_message\"\n    ],\n)\n\n\nclass CurrentSubscriptionInline(admin.TabularInline):\n    model = CurrentSubscription\n\n\ndef subscription_status(obj):\n    return obj.current_subscription.status\nsubscription_status.short_description = \"Subscription Status\"\n\n\nadmin.site.register(\n    Customer,\n    raw_id_fields=[\"subscriber\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"subscriber\",\n        \"card_kind\",\n        \"card_last_4\",\n        subscription_status,\n        \"created\"\n    ],\n    list_filter=[\n        \"card_kind\",\n        CustomerHasCardListFilter,\n        CustomerSubscriptionStatusListFilter\n    ],\n    search_fields=[\n        \"stripe_id\"\n    ],\n    inlines=[CurrentSubscriptionInline]\n)\n\n\nclass InvoiceItemInline(admin.TabularInline):\n    model = InvoiceItem\n\n\ndef customer_has_card(obj):\n    \"\"\" Returns True if the customer has a card attached to its account.\"\"\"\n    return obj.customer.card_fingerprint != \"\"\ncustomer_has_card.short_description = \"Customer Has Card\"\n\n\ndef customer_email(obj):\n    \"\"\" Returns a string representation of the customer's email.\"\"\"\n    return str(obj.customer.subscriber.email)\ncustomer_email.short_description = \"Customer\"\n\n\nadmin.site.register(\n    Invoice,\n    raw_id_fields=[\"customer\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"paid\",\n        \"closed\",\n        customer_email,\n        customer_has_card,\n        \"period_start\",\n        \"period_end\",\n        \"subtotal\",\n        \"total\",\n        \"created\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"customer__stripe_id\"\n    ],\n    list_filter=[\n        InvoiceCustomerHasCardListFilter,\n        \"paid\",\n        \"closed\",\n        \"attempted\",\n        \"attempts\",\n        \"created\",\n        \"date\",\n        \"period_end\",\n        \"total\"\n    ],\n    inlines=[InvoiceItemInline]\n)\n\n\nadmin.site.register(\n    Transfer,\n    raw_id_fields=[\"event\"],\n    readonly_fields=('created',),\n    list_display=[\n        \"stripe_id\",\n        \"amount\",\n        \"status\",\n        \"date\",\n        \"description\",\n        \"created\"\n    ],\n    search_fields=[\n        \"stripe_id\",\n        \"event__stripe_id\"\n    ]\n)\n\n\nclass PlanAdmin(admin.ModelAdmin):\n\n    def save_model(self, request, obj, form, change):\n        \"\"\"Update or create objects using our custom methods that\n        sync with Stripe.\"\"\"\n\n        if change:\n            obj.update_name()\n\n        else:\n            Plan.get_or_create(**form.cleaned_data)\n\n    def get_readonly_fields(self, request, obj=None):\n        readonly_fields = list(self.readonly_fields)\n        if obj:\n            readonly_fields.extend([\n                'stripe_id',\n                'amount',\n                'currency',\n                'interval',\n                'interval_count',\n                'trial_period_days'])\n\n        return readonly_fields\n\nadmin.site.register(Plan, PlanAdmin)\n", "path": "djstripe/admin.py"}]}