Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
A
acc_rest_api
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Ce projet est archivé. Le dépôt et les autres ressources du projet sont en lecture seule.
Afficher davantage de fils d'Ariane
Le Filament
Opération Auto-Consommation Collective
acc_rest_api
Validations
15472183
Valider
15472183
rédigé
Il y a 2 ans
par
Juliana
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
[ADD]Add page contact PRM
parent
47b12c06
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
services/operation_services.py
+45
-0
45 ajouts, 0 suppression
services/operation_services.py
avec
45 ajouts
et
0 suppression
services/operation_services.py
+
45
−
0
Voir le fichier @
15472183
...
@@ -540,6 +540,32 @@ class OperationsService(Component):
...
@@ -540,6 +540,32 @@ class OperationsService(Component):
}
}
return
datas
return
datas
@restapi.method
(
[([
"
/<int:id>/contact
"
],
"
GET
"
)],
output_param
=
restapi
.
CerberusValidator
(
"
_validator_return_get_contact
"
),
cors
=
"
*
"
,
crsf
=
False
,
)
def
get_contact
(
self
,
_id
):
"""
Retourne les données de l
'
opération
dans laquelle l
'
utilisateur ou sa société sont engagés
"""
operation
=
self
.
env
[
"
acc.operation
"
].
browse
(
_id
)
role
=
self
.
_get_role
(
operation
)
if
not
role
.
get
(
"
isIn
"
):
return
AccessError
()
datas
=
{
"
role
"
:
role
,
"
id
"
:
operation
.
id
,
"
name
"
:
operation
.
name
,
"
email
"
:
operation
.
pmo_id
.
email
}
return
datas
# ------------------------------------------------------
# ------------------------------------------------------
# Validators
# Validators
# ------------------------------------------------------
# ------------------------------------------------------
...
@@ -625,6 +651,25 @@ class OperationsService(Component):
...
@@ -625,6 +651,25 @@ class OperationsService(Component):
},
},
}
}
def
_validator_return_get_contact
(
self
):
return
{
"
role
"
:
{
"
type
"
:
"
dict
"
,
"
schema
"
:
{
"
id
"
:
{
"
type
"
:
"
integer
"
},
"
name
"
:
{
"
type
"
:
"
string
"
},
"
description
"
:
{
"
type
"
:
"
string
"
},
"
isIn
"
:
{
"
type
"
:
"
boolean
"
},
"
isPmo
"
:
{
"
type
"
:
"
boolean
"
},
"
isConsumer
"
:
{
"
type
"
:
"
boolean
"
},
"
isProductor
"
:
{
"
type
"
:
"
boolean
"
},
},
},
"
id
"
:
{
"
type
"
:
"
integer
"
},
"
name
"
:
{
"
type
"
:
"
string
"
},
"
email
"
:
{
"
type
"
:
"
string
"
},
}
def
_validator_get_doc
(
self
):
def
_validator_get_doc
(
self
):
return
{
return
{
"
id
"
:
{
"
type
"
:
"
integer
"
},
"
id
"
:
{
"
type
"
:
"
integer
"
},
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter