/usr/lib/python3/dist-packages/metadataserver/admin.py is in python3-django-maas 2.4.0~beta2-6865-gec43e47e6-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # Copyright 2014-2015 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Register models with Django.
We used to do this directly from `models/__init__.py`, as a side effect of
importing from that package, but it led to `AlreadyRegistered` errors when
running some tests in isolation (even when the import only happened once).
Django automatically discovers the `admin` module and ensures that models are
only registered once.
"""
__all__ = []
from django.apps import apps
from django.contrib import admin
# Register models in the admin site. When the DEBUG setting is enabled, the
# webapp will serve an administrator UI at /admin.
for model in apps.get_app_config('metadataserver').models.values():
admin.site.register(model)
|