-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from usnistgov/6.0.1.dev
6.0.1.dev
- Loading branch information
Showing
7 changed files
with
52 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +0,0 @@ | ||
import sys | ||
|
||
from django.apps import AppConfig | ||
from django.contrib.auth.decorators import login_required | ||
|
||
|
||
def init_admin_site(): | ||
from NEMO.views.customization import ApplicationCustomization, ProjectsAccountsCustomization | ||
from NEMO.admin import ProjectAdmin | ||
from django.contrib import admin | ||
|
||
# customize the site | ||
site_title = ApplicationCustomization.get("site_title", raise_exception=False) | ||
admin.site.login = login_required(admin.site.login) | ||
admin.site.site_header = site_title | ||
admin.site.site_title = site_title | ||
admin.site.index_title = "Detailed administration" | ||
# update the short_description for project's application identifier here after initialization | ||
ProjectAdmin.get_application_identifier.short_description = ProjectsAccountsCustomization.get( | ||
"project_application_identifier_name", raise_exception=False | ||
) | ||
|
||
|
||
def init_rates(): | ||
from NEMO.rates import rate_class | ||
|
||
rate_class.load_rates() | ||
|
||
|
||
class NEMOConfig(AppConfig): | ||
default_auto_field = "django.db.models.AutoField" | ||
name = "NEMO" | ||
|
||
def ready(self): | ||
if "migrate" in sys.argv or "makemigrations" in sys.argv: | ||
return | ||
from django.apps import apps | ||
|
||
if apps.is_installed("django.contrib.admin"): | ||
init_admin_site() | ||
init_rates() | ||
|
||
|
||
default_app_config = "NEMO.NEMOConfig" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import sys | ||
|
||
from django.apps import AppConfig | ||
from django.contrib.auth.decorators import login_required | ||
|
||
|
||
def init_admin_site(): | ||
from NEMO.views.customization import ApplicationCustomization, ProjectsAccountsCustomization | ||
from NEMO.admin import ProjectAdmin | ||
from django.contrib import admin | ||
|
||
# customize the site | ||
site_title = ApplicationCustomization.get("site_title", raise_exception=False) | ||
admin.site.login = login_required(admin.site.login) | ||
admin.site.site_header = site_title | ||
admin.site.site_title = site_title | ||
admin.site.index_title = "Detailed administration" | ||
# update the short_description for project's application identifier here after initialization | ||
ProjectAdmin.get_application_identifier.short_description = ProjectsAccountsCustomization.get( | ||
"project_application_identifier_name", raise_exception=False | ||
) | ||
|
||
|
||
def init_rates(): | ||
from NEMO.rates import rate_class | ||
|
||
rate_class.load_rates() | ||
|
||
|
||
class NEMOConfig(AppConfig): | ||
default_auto_field = "django.db.models.AutoField" | ||
name = "NEMO" | ||
|
||
def ready(self): | ||
if "migrate" in sys.argv or "makemigrations" in sys.argv: | ||
return | ||
from django.apps import apps | ||
|
||
if apps.is_installed("django.contrib.admin"): | ||
init_admin_site() | ||
init_rates() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ | |
"trunc": trunc, | ||
"sqrt": sqrt, | ||
"sum": sum, | ||
"max": max, | ||
"min": min, | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters