mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-27 10:04:49 +00:00
Fix using modeladmin_register as a decorator
Using `modeladmin_register` as a decorator worked, and the ModelAdmin subclass was registered successfully, but as `modeladmin_register` did not return the ModelAdmin subclass, the decorated class would be `None`. Returning the class prevents this issue, so `modeladmin_register` will now work as expected as a decorator.
This commit is contained in:
parent
9ec8daba43
commit
83c0ef42da
1 changed files with 1 additions and 0 deletions
|
|
@ -593,3 +593,4 @@ def modeladmin_register(modeladmin_class):
|
|||
"""
|
||||
instance = modeladmin_class()
|
||||
instance.register_with_wagtail()
|
||||
return modeladmin_class
|
||||
|
|
|
|||
Loading…
Reference in a new issue