Django admin list_display eats AttributeError by mistake
When Django admin list_display calling custom method, the exception AttributeError can't be seen.
See the sample snippets below.
class ExampleAdmin(admin.ModelAdmin):
def example(self, field):
raise AttributeError
list_display = ('example',)
class ExampleAdmin(admin.ModelAdmin):
def example(self, field):
a = 1
a.encode("utf8")
list_display = ('example',)
Change History
(5)
Has patch: |
set
|
Owner: |
changed from nobody to thikonom
|
Status: |
new → assigned
|
Needs tests: |
set
|
Owner: |
changed from thikonom to Travis Swicegood
|
Patch needs improvement: |
set
|
Status: |
assigned → new
|
Triage Stage: |
Unreviewed → Accepted
|
Resolution: |
→ duplicate
|
Status: |
new → closed
|
Since i suppose the AttributeError is catched this way by design,
i amended the code to distinguish between the Exception raise by the model itself or by any other object