Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o
Commits
0ceead79
Commit
0ceead79
authored
Jul 15, 2018
by
Hugo LEVY-FALK
Browse files
Fix l'édition de OptionalUser
parent
cc21c7a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
preferences/forms.py
View file @
0ceead79
...
...
@@ -38,6 +38,7 @@ from .models import (
Service
)
class
EditOptionalUserForm
(
ModelForm
):
"""Formulaire d'édition des options de l'user. (solde, telephone..)"""
class
Meta
:
...
...
@@ -54,13 +55,6 @@ class EditOptionalUserForm(ModelForm):
self
.
fields
[
'is_tel_mandatory'
].
label
=
(
'Exiger un numéro de téléphone'
)
self
.
fields
[
'user_solde'
].
label
=
(
'Activation du solde pour les utilisateurs'
)
self
.
fields
[
'max_solde'
].
label
=
'Solde maximum'
self
.
fields
[
'min_online_payment'
].
label
=
(
'Montant de rechargement minimum en ligne'
)
self
.
fields
[
'self_adhesion'
].
label
=
'Auto inscription'
...
...
preferences/models.py
View file @
0ceead79
...
...
@@ -31,7 +31,6 @@ from django.db.models.signals import post_save
from
django.dispatch
import
receiver
from
django.core.cache
import
cache
import
cotisations.models
import
machines.models
from
re2o.mixins
import
AclMixin
...
...
@@ -90,11 +89,6 @@ class OptionalUser(AclMixin, PreferencesModel):
(
"view_optionaluser"
,
"Peut voir les options de l'user"
),
)
def
clean
(
self
):
"""Creation du mode de paiement par solde"""
if
self
.
user_solde
:
cotisations
.
models
.
Paiement
.
objects
.
get_or_create
(
is_balance
=
True
)
@
receiver
(
post_save
,
sender
=
OptionalUser
)
def
optionaluser_post_save
(
**
kwargs
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment