This commit is contained in:
Martin Pépin 2017-10-26 09:34:56 +02:00
parent 2aa2dafa13
commit 63963ce1f0
5 changed files with 18 additions and 37 deletions

View file

@ -4,23 +4,6 @@ from .decorators import buro_required
from . import views, petits_cours_views from . import views, petits_cours_views
export_patterns = [
url(r'^members$',
views.export_members,
name="export.members"),
url(r'^mega/avecremarques$', views.export_mega_remarksonly),
url(r'^mega/participants$',
views.export_mega_participants,
name="export.mega.participants"),
url(r'^mega/orgas$',
views.export_mega_orgas,
name="export.mega.orgas"),
url(r'^mega/(?P<type>.+)$', views.export_mega_bytype),
url(r'^mega$',
views.export_mega,
name="export.mega"),
]
petitcours_patterns = [ petitcours_patterns = [
url(r'^inscription$', petits_cours_views.inscription, url(r'^inscription$', petits_cours_views.inscription,
name='petits-cours-inscription'), name='petits-cours-inscription'),

View file

@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
""" """
Django common settings for cof project. Django common settings for GestioCOF
Everything which is supposed to be identical between the production server and Everything which is supposed to be identical between the production server and
the local development server should be here. the local development server should be here.
@ -55,26 +54,22 @@ BASE_DIR = os.path.dirname(
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
'gestioncof',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.sites', 'django.contrib.sites',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'grappelli',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.admindocs', 'django.contrib.admindocs',
'bda',
'autocomplete_light', 'autocomplete_light',
'captcha', 'captcha',
'django_cas_ng', 'django_cas_ng',
'bootstrapform', 'bootstrapform',
'kfet',
'kfet.open',
'channels', 'channels',
'widget_tweaks', 'widget_tweaks',
'custommail', 'custommail',
'nested_admin',
'djconfig', 'djconfig',
'wagtail.wagtailforms', 'wagtail.wagtailforms',
'wagtail.wagtailredirects', 'wagtail.wagtailredirects',
@ -91,6 +86,12 @@ INSTALLED_APPS = [
'wagtailmenus', 'wagtailmenus',
'modelcluster', 'modelcluster',
'taggit', 'taggit',
'bda.apps.BdAConfig',
'bds.apps.BDSConfig',
'cof.apps.COFConfig',
'gestion.apps.GestionConfig',
'kfet',
'kfet.open',
'kfet.auth', 'kfet.auth',
'kfet.cms', 'kfet.cms',
] ]
@ -110,7 +111,7 @@ MIDDLEWARE_CLASSES = [
'wagtail.wagtailredirects.middleware.RedirectMiddleware', 'wagtail.wagtailredirects.middleware.RedirectMiddleware',
] ]
ROOT_URLCONF = 'cof.urls' ROOT_URLCONF = 'gestioCOF.urls'
TEMPLATES = [ TEMPLATES = [
{ {
@ -123,12 +124,12 @@ TEMPLATES = [
'django.template.context_processors.request', 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth', 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 'django.contrib.messages.context_processors.messages',
'django.core.context_processors.i18n', 'django.template.context_processors.i18n',
'django.core.context_processors.media', 'django.template.context_processors.media',
'django.core.context_processors.static', 'django.template.context_processors.static',
'wagtailmenus.context_processors.wagtailmenus', 'wagtailmenus.context_processors.wagtailmenus',
'djconfig.context_processors.config', 'djconfig.context_processors.config',
'gestioncof.shared.context_processor', 'gestion.context_processors.context_processor',
'kfet.auth.context_processors.temporary_auth', 'kfet.auth.context_processors.temporary_auth',
'kfet.context_processors.config', 'kfet.context_processors.config',
], ],

View file

@ -1,4 +1,3 @@
import autocomplete_light
import gestion.urls import gestion.urls
import kfet.urls import kfet.urls
import bda.urls import bda.urls
@ -14,13 +13,11 @@ from django.contrib import admin
from django.contrib.auth import views as django_views from django.contrib.auth import views as django_views
from cof import views as cof_views from cof import views as cof_views
from cof.urls import export_patterns, petitcours_patterns, \ from cof.urls import petitcours_patterns, surveys_patterns, calendar_patterns
surveys_patterns, calendar_patterns
from cof.autocomplete import autocomplete from cof.autocomplete import autocomplete
from gestion import views as gestion_views from gestion import views as gestion_views
autocomplete_light.autodiscover()
admin.autodiscover() admin.autodiscover()
urlpatterns = [ urlpatterns = [
@ -34,8 +31,6 @@ urlpatterns = [
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
# Le BdA # Le BdA
url(r'^bda/', include(bda.urls)), url(r'^bda/', include(bda.urls)),
# Les exports
url(r'^export/', include(export_patterns)),
# Les petits cours # Les petits cours
url(r'^petitcours/', include(petitcours_patterns)), url(r'^petitcours/', include(petitcours_patterns)),
# Les sondages # Les sondages

View file

@ -93,6 +93,7 @@ class AccountPwdForm(forms.Form):
raise ValidationError("Les mots de passes sont différents") raise ValidationError("Les mots de passes sont différents")
super(AccountPwdForm, self).clean() super(AccountPwdForm, self).clean()
class ProfileForm(forms.ModelForm): class ProfileForm(forms.ModelForm):
# def clean_is_cof(self): # def clean_is_cof(self):
# instance = getattr(self, 'instance', None) # instance = getattr(self, 'instance', None)
@ -106,6 +107,7 @@ class ProfileForm(forms.ModelForm):
# XXX. I am removing is_cof from here. # XXX. I am removing is_cof from here.
fields = ['login_clipper', 'departement'] fields = ['login_clipper', 'departement']
class ProfileRestrictForm(ProfileForm): class ProfileRestrictForm(ProfileForm):
class Meta(ProfileForm.Meta): class Meta(ProfileForm.Meta):
fields = ['departement'] fields = ['departement']

View file

@ -33,7 +33,7 @@ from .config import kfet_config
from .decorators import teamkfet_required from .decorators import teamkfet_required
from .forms import ( from .forms import (
AccountTriForm, AccountBalanceForm, AccountNoTriForm, UserForm, AccountTriForm, AccountBalanceForm, AccountNoTriForm, UserForm,
UserRestrictTeamForm, UserGroupForm, AccountForm, CofRestrictForm, UserRestrictTeamForm, UserGroupForm, AccountForm, UserRestrictForm,
AccountPwdForm, AccountNegativeForm, UserRestrictForm, AccountRestrictForm, AccountPwdForm, AccountNegativeForm, UserRestrictForm, AccountRestrictForm,
CheckoutForm, CheckoutRestrictForm, CheckoutStatementCreateForm, CheckoutForm, CheckoutRestrictForm, CheckoutStatementCreateForm,
CheckoutStatementUpdateForm, ArticleForm, ArticleRestrictForm, CheckoutStatementUpdateForm, ArticleForm, ArticleRestrictForm,