Skip to content

Commit

Permalink
Added settings parameter disable_categories to fix error 500 on proje…
Browse files Browse the repository at this point in the history
…ct creation.

Co-authored-by: Fabian Brand <brand@imbie.meb.uni-bonn.de>
  • Loading branch information
Fabian Brand authored and holtgrewe committed Jun 17, 2021
1 parent 8591d7b commit bde924d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
9 changes: 9 additions & 0 deletions HISTORY.rst
Expand Up @@ -2,6 +2,15 @@
History / Changelog
===================

-----------------
HEAD (unreleased)
-----------------

Full Change List
================

- Fix for missing PROJECTROLES_DISABLE_CATEGORIES variable in settings.

-------
v0.23.7
-------
Expand Down
20 changes: 14 additions & 6 deletions config/settings/base.py
Expand Up @@ -497,7 +497,7 @@ def fixed_array_type(field):

# Varfish: MutationTaster URL
VARFISH_MUTATIONTASTER_REST_API_URL = env.str(
"VARFISH_MUTATIONTASTER_REST_API_URL", "https://www.mutationdistiller.org/MTc/MT_API.cgi"
"VARFISH_MUTATIONTASTER_REST_API_URL", "https://www.mutationdistiller.org/MTc/MT_API.cgi",
)
VARFISH_MUTATIONTASTER_BATCH_VARS = env.int("VARFISH_MUTATIONTASTER_BATCH_VARS", 50)
VARFISH_MUTATIONTASTER_MAX_VARS = env.int("VARFISH_MUTATIONTASTER_MAX_VARS", 500)
Expand Down Expand Up @@ -579,6 +579,8 @@ def fixed_array_type(field):
ENABLED_BACKEND_PLUGINS = ["timeline_backend"]
ENABLED_BACKEND_PLUGINS += env.list("ENABLED_BACKEND_PLUGINS", None, [])

PROJECTROLES_DISABLE_CATEGORIES = env.bool("PROJECTROLES_DISABLE_CATEGORIES", False)

# Warn about unsupported browsers (IE)
PROJECTROLES_BROWSER_WARNING = True

Expand Down Expand Up @@ -621,7 +623,7 @@ def set_logging(debug):
"disable_existing_loggers": False,
"formatters": {"simple": {"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s"}},
"handlers": {
"console": {"level": "DEBUG", "class": "logging.StreamHandler", "formatter": "simple"}
"console": {"level": "DEBUG", "class": "logging.StreamHandler", "formatter": "simple",}
},
"loggers": {
"projectroles": {"level": "INFO", "handlers": ["console"], "propagate": True,},
Expand All @@ -642,7 +644,11 @@ def set_logging(debug):
# Default values
LDAP_DEFAULT_CONN_OPTIONS = {ldap.OPT_REFERRALS: 0}
LDAP_DEFAULT_FILTERSTR = "(sAMAccountName=%(user)s)"
LDAP_DEFAULT_ATTR_MAP = {"first_name": "givenName", "last_name": "sn", "email": "mail"}
LDAP_DEFAULT_ATTR_MAP = {
"first_name": "givenName",
"last_name": "sn",
"email": "mail",
}

# Primary LDAP server
AUTH_LDAP_SERVER_URI = env.str("AUTH_LDAP_SERVER_URI", None)
Expand All @@ -651,7 +657,7 @@ def set_logging(debug):
AUTH_LDAP_CONNECTION_OPTIONS = LDAP_DEFAULT_CONN_OPTIONS

AUTH_LDAP_USER_SEARCH = LDAPSearch(
env.str("AUTH_LDAP_USER_SEARCH_BASE", None), ldap.SCOPE_SUBTREE, LDAP_DEFAULT_FILTERSTR
env.str("AUTH_LDAP_USER_SEARCH_BASE", None), ldap.SCOPE_SUBTREE, LDAP_DEFAULT_FILTERSTR,
)
AUTH_LDAP_USER_ATTR_MAP = LDAP_DEFAULT_ATTR_MAP
AUTH_LDAP_USERNAME_DOMAIN = env.str("AUTH_LDAP_USERNAME_DOMAIN", None)
Expand All @@ -669,15 +675,17 @@ def set_logging(debug):
AUTH_LDAP2_CONNECTION_OPTIONS = LDAP_DEFAULT_CONN_OPTIONS

AUTH_LDAP2_USER_SEARCH = LDAPSearch(
env.str("AUTH_LDAP2_USER_SEARCH_BASE", None), ldap.SCOPE_SUBTREE, LDAP_DEFAULT_FILTERSTR
env.str("AUTH_LDAP2_USER_SEARCH_BASE", None),
ldap.SCOPE_SUBTREE,
LDAP_DEFAULT_FILTERSTR,
)
AUTH_LDAP2_USER_ATTR_MAP = LDAP_DEFAULT_ATTR_MAP
AUTH_LDAP2_USERNAME_DOMAIN = env.str("AUTH_LDAP2_USERNAME_DOMAIN")
AUTH_LDAP2_DOMAIN_PRINTABLE = env.str("AUTH_LDAP2_DOMAIN_PRINTABLE", None)

AUTHENTICATION_BACKENDS = tuple(
itertools.chain(
("projectroles.auth_backends.SecondaryLDAPBackend",), AUTHENTICATION_BACKENDS
("projectroles.auth_backends.SecondaryLDAPBackend",), AUTHENTICATION_BACKENDS,
)
)

Expand Down

0 comments on commit bde924d

Please sign in to comment.