1 # -*- encoding: utf-8 -*-
7 from project
.conf
import * # NOQA
11 from project
.groups
import DRH_NIVEAU_1
, DRH_NIVEAU_2
13 PROJET_TITRE
= "Ressources humaines"
16 SERVER_EMAIL
= 'ne-pas-repondre@auf.org'
17 EMAIL_SUBJECT_PREFIX
= '[auf_rh_dae - %s] ' % socket
.gethostname()
22 TIME_ZONE
= 'America/Montreal'
24 FORMAT_MODULE_PATH
= 'project.formats'
26 USE_THOUSAND_SEPARATOR
= False
28 DATE_INPUT_FORMATS
= ('%d-%m-%Y', )
30 SESSION_SAVE_EVERY_REQUEST
= True
31 SESSION_EXPIRE_AT_BROWSER_CLOSE
= True
33 PROJECT_ROOT
= os
.path
.dirname(__file__
)
34 SITE_ROOT
= os
.path
.dirname(PROJECT_ROOT
)
36 # Absolute path to the directory that holds media.
37 # Example: "/home/media/media.lawrence.com/"
38 MEDIA_ROOT
= os
.path
.join(PROJECT_ROOT
, 'media')
39 PRIVE_MEDIA_ROOT
= os
.path
.join(PROJECT_ROOT
, 'media_prive')
42 os
.path
.join(PROJECT_ROOT
, 'assets'),
44 STATIC_ROOT
= os
.path
.join(PROJECT_ROOT
, 'static')
45 STATIC_URL
= '/static/'
47 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
48 # trailing slash if there is a path component (optional in other cases).
49 # Examples: "http://media.lawrence.com", "http://example.com/media/"
51 PRIVE_MEDIA_URL
= '/prive/'
52 OE_PRIVE_MEDIA_URL
= '/recrutement/prive/'
54 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
56 # Examples: "http://foo.com/media/", "/media/".
57 #ADMIN_MEDIA_PREFIX = '/media/django/'
59 # Don't share this with anybody.
60 SECRET_KEY
= '^2w#%abp_d+e#(7f5w$leef50)c@4y38cnn#ccji@84$2^rt#l'
62 MIDDLEWARE_CLASSES
= (
63 'django.middleware.common.CommonMiddleware',
64 'django.contrib.sessions.middleware.SessionMiddleware',
65 'django.contrib.messages.middleware.MessageMiddleware',
66 'django.contrib.auth.middleware.AuthenticationMiddleware',
67 'auf.django.saml.middleware.SPMiddleware',
68 'auf.django.piwik.middleware.TrackMiddleware',
69 'django.middleware.doc.XViewMiddleware',
70 'reversion.middleware.RevisionMiddleware',
73 ROOT_URLCONF
= 'project.urls'
77 'auf.django.references',
79 'auf.django.admingroup',
80 'auf.django.workflow',
81 'auf.django.permissions',
87 'admin_tools.theming',
89 'admin_tools.dashboard',
90 'django.contrib.admin',
91 'django.contrib.auth',
92 'django.contrib.contenttypes',
93 'django.contrib.humanize',
94 'django.contrib.messages',
95 'django.contrib.sessions',
96 'django.contrib.staticfiles',
100 'raven.contrib.django',
108 'project.recrutement',
111 TEMPLATE_CONTEXT_PROCESSORS
= (
112 'django.contrib.auth.context_processors.auth',
113 'django.core.context_processors.debug',
114 'django.core.context_processors.i18n',
115 'django.core.context_processors.media',
116 'django.core.context_processors.static',
117 'django.contrib.messages.context_processors.messages',
118 'django.core.context_processors.request',
119 'auf.django.skin.context_processors.auf',
120 'project.dae.context_processors.user_in_dae_groupes',
123 AUTHENTICATION_BACKENDS
= (
124 'auf.django.saml.backends.SPBackend',
125 'auf.django.permissions.backends.AuthenticationBackend',
129 os
.path
.join(os
.path
.dirname(__file__
), "templates"),
133 ADMIN_TOOLS_INDEX_DASHBOARD
= 'project.dashboard.CustomIndexDashboard'
134 ADMIN_TOOLS_APP_INDEX_DASHBOARD
= 'project.dashboard.CustomAppIndexDashboard'
135 ADMIN_TOOLS_MENU
= 'project.menu.CustomMenu'
137 AJAX_LOOKUP_CHANNELS
= {
138 'responsables': ('project.dae.catalogues', 'Responsable'),
139 'dae_dossiers': ('project.dae.catalogues', 'Dossier'),
140 'dae_postes': ('project.dae.catalogues', 'Poste'),
141 'pays': ('project.rh.catalogues', 'Pays'),
142 'implantations': ('project.rh.catalogues', 'Implantation'),
143 'typepostes': ('project.rh.catalogues', 'TypePoste'),
144 'postes': ('project.rh.catalogues', 'Poste'),
145 'valeurpoints': ('project.rh.catalogues', 'ValeurPoint'),
146 'employes': ('project.rh.catalogues', 'Employe'),
147 'dossiers': ('project.rh.catalogues', 'Dossier'),
149 AJAX_SELECT_INLINES
= 'inline'
152 TINYMCE_DEFAULT_CONFIG
= {
155 'theme_advanced_buttons1': (
156 "bold,italic,underline,|,formatselect,|,bullist,numlist,|,undo,redo,|,"
159 'theme_advanced_buttons2': "",
160 'theme_advanced_buttons3': "",
161 'theme_advanced_statusbar_location': "bottom",
162 'theme_advanced_toolbar_align': "left",
163 'theme_advanced_styles': "Titre=titre;Sous-titre=sous-titre;Normal=normal",
166 'theme_advanced_resizing': "true",
167 'custom_undo_redo_levels': 10,
168 'theme_advanced_toolbar_location': 'top',
169 'inline_styles': 'false',
170 'paste_use_dialog': 'false',
171 'paste_auto_cleanup_on_paste': 'true',
172 'paste_convert_headers_to_strong': 'false',
173 'paste_strip_class_attributes': 'all',
174 'paste_remove_spans': 'true',
175 'paste_remove_styles': 'true',
176 'content_css': '/media/css/tinymce.css',
180 SENDFILE_BACKEND
= 'sendfile.backends.simple'
182 QBE_DISPLAY_DATABASES
= False
184 # Il est *très* important de respecter la case.
185 QBE_CUSTOM_MODELS
= {'Rh': {
193 QBE_ALLOWED_FIELDS
= {'Rh': {
195 'nom', 'prenom', 'genre', 'date_naissance', 'situation_familiale',
198 'Poste': ['nom', 'date_debut', 'date_fin'],
200 'statut_residence', 'regime_travail',
201 'regime_travail_nb_heure_semaine', 'date_debut', 'date_fin'
203 'Remuneration': ['montant', 'date_debut', 'date_fin'],
204 'Contrat': ['date_debut', 'date_fin'],
207 SOUTH_TESTS_MIGRATE
= False
211 'disable_existing_loggers': True,
214 'handlers': ['sentry'],
218 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
224 'class': 'raven.contrib.django.handlers.SentryHandler',
228 'class': 'logging.StreamHandler',
229 'formatter': 'verbose'
233 'django.db.backends': {
235 'handlers': ['console'],
240 'handlers': ['console'],
245 'handlers': ['console'],
253 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
257 # Pour accéder aux requêtes savegardées, il faut définir les permissions dans
259 def qbe_access(user
):
260 grps_user
= [g
.name
for g
in user
.groups
.all()]
261 inter
= [g
for g
in grps_user
if g
in (DRH_NIVEAU_1
, DRH_NIVEAU_2
, )]
262 return len(inter
) > 0
263 QBE_ACCESS_FOR
= qbe_access