1 # -*- encoding: utf-8 -*-
5 from project
.conf
import * # NOQA
6 from project
.groups
import DRH_NIVEAU_1
, DRH_NIVEAU_2
8 PROJET_TITRE
= "Ressources humaines"
11 SERVER_EMAIL
= 'ne-pas-repondre@auf.org'
12 EMAIL_SUBJECT_PREFIX
= '[auf_rh_dae - %s] ' % socket
.gethostname()
17 TIME_ZONE
= 'America/Montreal'
19 FORMAT_MODULE_PATH
= 'project.formats'
21 USE_THOUSAND_SEPARATOR
= False
23 DATE_INPUT_FORMATS
= ('%d-%m-%Y', )
25 SESSION_SAVE_EVERY_REQUEST
= True
26 SESSION_EXPIRE_AT_BROWSER_CLOSE
= True
28 PROJECT_ROOT
= os
.path
.dirname(__file__
)
29 SITE_ROOT
= os
.path
.dirname(PROJECT_ROOT
)
31 # Absolute path to the directory that holds media.
32 # Example: "/home/media/media.lawrence.com/"
33 MEDIA_ROOT
= os
.path
.join(PROJECT_ROOT
, 'media')
34 PRIVE_MEDIA_ROOT
= os
.path
.join(PROJECT_ROOT
, 'media_prive')
37 os
.path
.join(PROJECT_ROOT
, 'assets'),
39 STATIC_ROOT
= os
.path
.join(PROJECT_ROOT
, 'static')
40 STATIC_URL
= '/static/'
42 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
43 # trailing slash if there is a path component (optional in other cases).
44 # Examples: "http://media.lawrence.com", "http://example.com/media/"
46 PRIVE_MEDIA_URL
= '/prive/'
47 OE_PRIVE_MEDIA_URL
= '/recrutement/prive/'
49 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
51 # Examples: "http://foo.com/media/", "/media/".
52 #ADMIN_MEDIA_PREFIX = '/media/django/'
54 # Don't share this with anybody.
55 SECRET_KEY
= '^2w#%abp_d+e#(7f5w$leef50)c@4y38cnn#ccji@84$2^rt#l'
57 MIDDLEWARE_CLASSES
= (
58 'django.middleware.common.CommonMiddleware',
59 'django.contrib.sessions.middleware.SessionMiddleware',
60 'django.contrib.messages.middleware.MessageMiddleware',
61 'django.contrib.auth.middleware.AuthenticationMiddleware',
62 'auf.django.saml.middleware.SPMiddleware',
63 'auf.django.piwik.middleware.TrackMiddleware',
64 'django.middleware.doc.XViewMiddleware',
65 'reversion.middleware.RevisionMiddleware',
68 ROOT_URLCONF
= 'project.urls'
72 'auf.django.references',
74 'auf.django.admingroup',
75 'auf.django.workflow',
76 'auf.django.permissions',
81 'admin_tools.theming',
83 'admin_tools.dashboard',
84 'django.contrib.admin',
85 'django.contrib.auth',
86 'django.contrib.contenttypes',
87 'django.contrib.humanize',
88 'django.contrib.messages',
89 'django.contrib.sessions',
90 'django.contrib.staticfiles',
94 'raven.contrib.django',
102 'project.recrutement',
105 TEMPLATE_CONTEXT_PROCESSORS
= (
106 'django.contrib.auth.context_processors.auth',
107 'django.core.context_processors.debug',
108 'django.core.context_processors.i18n',
109 'django.core.context_processors.media',
110 'django.core.context_processors.static',
111 'django.contrib.messages.context_processors.messages',
112 'django.core.context_processors.request',
113 'auf.django.skin.context_processors.auf',
114 'project.dae.context_processors.user_in_dae_groupes',
117 AUTHENTICATION_BACKENDS
= (
118 'auf.django.saml.backends.SPBackend',
119 'auf.django.permissions.backends.AuthenticationBackend',
123 os
.path
.join(os
.path
.dirname(__file__
), "templates"),
127 ADMIN_TOOLS_INDEX_DASHBOARD
= 'project.dashboard.CustomIndexDashboard'
128 ADMIN_TOOLS_APP_INDEX_DASHBOARD
= 'project.dashboard.CustomAppIndexDashboard'
129 ADMIN_TOOLS_MENU
= 'project.menu.CustomMenu'
131 AJAX_LOOKUP_CHANNELS
= {
132 'responsables': ('project.dae.catalogues', 'Responsable'),
133 'dae_dossiers': ('project.dae.catalogues', 'Dossier'),
134 'dae_postes': ('project.dae.catalogues', 'Poste'),
135 'pays': ('project.rh.catalogues', 'Pays'),
136 'implantations': ('project.rh.catalogues', 'Implantation'),
137 'typepostes': ('project.rh.catalogues', 'TypePoste'),
138 'postes': ('project.rh.catalogues', 'Poste'),
139 'valeurpoints': ('project.rh.catalogues', 'ValeurPoint'),
140 'employes': ('project.rh.catalogues', 'Employe'),
141 'dossiers': ('project.rh.catalogues', 'Dossier'),
143 AJAX_SELECT_INLINES
= 'inline'
146 TINYMCE_DEFAULT_CONFIG
= {
149 'theme_advanced_buttons1': (
150 "bold,italic,underline,|,formatselect,|,bullist,numlist,|,undo,redo,|,"
153 'theme_advanced_buttons2': "",
154 'theme_advanced_buttons3': "",
155 'theme_advanced_statusbar_location': "bottom",
156 'theme_advanced_toolbar_align': "left",
157 'theme_advanced_styles': "Titre=titre;Sous-titre=sous-titre;Normal=normal",
160 'theme_advanced_resizing': "true",
161 'custom_undo_redo_levels': 10,
162 'theme_advanced_toolbar_location': 'top',
163 'inline_styles': 'false',
164 'paste_use_dialog': 'false',
165 'paste_auto_cleanup_on_paste': 'true',
166 'paste_convert_headers_to_strong': 'false',
167 'paste_strip_class_attributes': 'all',
168 'paste_remove_spans': 'true',
169 'paste_remove_styles': 'true',
170 'content_css': '/media/css/tinymce.css',
174 SENDFILE_BACKEND
= 'sendfile.backends.simple'
176 QBE_DISPLAY_DATABASES
= False
178 # Il est *très* important de respecter la case.
179 QBE_CUSTOM_MODELS
= {'Rh': {
187 QBE_ALLOWED_FIELDS
= {'Rh': {
189 'nom', 'prenom', 'genre', 'date_naissance', 'situation_familiale',
192 'Poste': ['nom', 'date_debut', 'date_fin'],
194 'statut_residence', 'regime_travail',
195 'regime_travail_nb_heure_semaine', 'date_debut', 'date_fin'
197 'Remuneration': ['montant', 'date_debut', 'date_fin'],
198 'Contrat': ['date_debut', 'date_fin'],
201 SOUTH_TESTS_MIGRATE
= False
205 'disable_existing_loggers': True,
208 'handlers': ['sentry'],
212 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
218 'class': 'raven.contrib.django.handlers.SentryHandler',
222 'class': 'logging.StreamHandler',
223 'formatter': 'verbose'
227 'django.db.backends': {
229 'handlers': ['console'],
234 'handlers': ['console'],
239 'handlers': ['console'],
245 # Pour accéder aux requêtes savegardées, il faut définir les permissions dans
247 def qbe_access(user
):
248 grps_user
= [g
.name
for g
in user
.groups
.all()]
249 inter
= [g
for g
in grps_user
if g
in (DRH_NIVEAU_1
, DRH_NIVEAU_2
, )]
250 return len(inter
) > 0
251 QBE_ACCESS_FOR
= qbe_access