Skip to content

Commit

Permalink
Administration: allow registering non-resource custom views
Browse files Browse the repository at this point in the history
  • Loading branch information
Pineirin authored and kpsherva committed Oct 5, 2022
1 parent 745f420 commit 2bf3b9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions invenio_administration/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from . import config
from .admin import Administration
from .views.base import AdminView
from .views.base import AdminResourceBaseView, AdminView


class InvenioAdministration:
Expand Down Expand Up @@ -79,7 +79,8 @@ def register_view(self, view_class, extension_name, app, *args, **kwargs):
**kwargs,
)
self.administration.add_view(view, view_instance, *args, **kwargs)
self.register_resource(app, view_class, extension_name)
if issubclass(view_class, AdminResourceBaseView):
self.register_resource(app, view_class, extension_name)

@staticmethod
def register_resource(app, view_class, extension_name):
Expand Down

0 comments on commit 2bf3b9d

Please sign in to comment.