Skip to content
Extraits de code Groupes Projets
Valider 4a9133f2 rédigé par Julien - Le Filament's avatar Julien - Le Filament
Parcourir les fichiers

[FIX] fix 401 when superadmin export cdc

parent 5f924879
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!10[FIX] fix 401 when superadmin export cdc
......@@ -233,9 +233,11 @@ class CustomerPortal(CustomerPortal):
if (
request.env.user.commercial_partner_id.id
not in operation.partner_role_ids.partner_id.ids
and not request.env.user.has_group("oacc.group_operation_superadmin")
):
raise AccessError(_("You are not allowed to access this operation"))
roles = self._get_role(operation)
except AccessError as e:
raise werkzeug.exceptions.abort(
werkzeug.wrappers.Response(status=401)
......
......@@ -100,8 +100,6 @@ def make_cons_data(energy_dict):
period.strftime("%d/%m/%Y %H:%M"),
# consommation en kwh
str(round(energy_dict[period]["cons"], rounding)),
# autocons
str(round(energy_dict[period]["autocons"], rounding)),
# allocons
str(
round(
......@@ -110,6 +108,8 @@ def make_cons_data(energy_dict):
rounding,
)
),
# autocons
str(round(energy_dict[period]["autocons"], rounding)),
]
)
)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter