Skip to content

Commit

Permalink
Moved log levles and property types out of __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWatzinger committed Oct 4, 2023
1 parent 0e257bf commit 2dd27e1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
31 changes: 7 additions & 24 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
VERSION = '7.17.0'
DATABASE_VERSION = DATABASE_VERSIONS[0]
DEMO_MODE = False # If activated some options are disabled, login is prefilled

LANGUAGES = {
'ca': 'Català',
'de': 'Deutsch',
'en': 'English',
'es': 'Español',
'fr': 'Français'}
DEBUG = False

DATABASE_NAME = 'openatlas'
Expand All @@ -23,6 +16,13 @@
MAIL_PASSWORD = 'CHANGE ME'
SECRET_KEY = 'CHANGE ME' # Used for cookies

LANGUAGES = {
'ca': 'Català',
'de': 'Deutsch',
'en': 'English',
'es': 'Español',
'fr': 'Français'}

# Files with these extensions are can be displayed in the browser
DISPLAY_FILE_EXTENSIONS = \
['.bmp', '.gif', '.ico', '.jpeg', '.jpg', '.png', '.svg']
Expand Down Expand Up @@ -105,25 +105,8 @@
# Minimum required characters for table filters
MIN_CHARS_JSTREE_SEARCH = 1

LOG_LEVELS = {
0: 'emergency',
1: 'alert',
2: 'critical',
3: 'error',
4: 'warn',
5: 'notice',
6: 'info',
7: 'debug'}

CSS = {
'string_field': 'form-control form-control-sm',
'button': {
'primary': 'btn btn-outline-primary btn-sm',
'secondary': 'btn btn-outline-secondary btn-sm'}}

# Property types work differently, e.g. no move functionality
PROPERTY_TYPES = [
'Actor relation',
'Actor function',
'External reference match',
'Involvement']
10 changes: 10 additions & 0 deletions openatlas/models/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
from openatlas.models.imports import Import
from openatlas.models.user import User

app.config['LOG_LEVELS'] = {
0: 'emergency',
1: 'alert',
2: 'critical',
3: 'error',
4: 'warn',
5: 'notice',
6: 'info',
7: 'debug'}


class Logger:

Expand Down
8 changes: 8 additions & 0 deletions openatlas/models/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
from openatlas.models.entity import Entity


# Property types work differently, e.g. no move functionality
app.config['PROPERTY_TYPES'] = [
'Actor relation',
'Actor function',
'External reference match',
'Involvement']


class Type(Entity):
count = 0
count_subs = 0
Expand Down

0 comments on commit 2dd27e1

Please sign in to comment.