Remove unused permission

This commit is contained in:
Ludovic Stephan 2021-02-24 00:26:16 +01:00
parent 63738e8e02
commit 93d283fecb
2 changed files with 30 additions and 4 deletions

View file

@ -0,0 +1,30 @@
# Generated by Django 2.2.17 on 2021-02-23 23:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("kfet", "0076_unfreeze_accounts"),
]
operations = [
migrations.AlterModelOptions(
name="operation",
options={
"permissions": (
("perform_deposit", "Effectuer une charge"),
(
"perform_negative_operations",
"Enregistrer des commandes en négatif",
),
("cancel_old_operations", "Annuler des commandes non récentes"),
(
"perform_commented_operations",
"Enregistrer des commandes avec commentaires",
),
)
},
),
]

View file

@ -180,9 +180,6 @@ class Account(models.Model):
return set(), False
if self.need_comment:
perms.add("kfet.perform_commented_operations")
# Checking is frozen account
if self.is_frozen:
perms.add("kfet.override_frozen_protection")
new_balance = self.balance + amount
if new_balance < 0 and amount < 0:
# Retrieving overdraft amount limit
@ -726,7 +723,6 @@ class Operation(models.Model):
permissions = (
("perform_deposit", "Effectuer une charge"),
("perform_negative_operations", "Enregistrer des commandes en négatif"),
("override_frozen_protection", "Forcer le gel d'un compte"),
("cancel_old_operations", "Annuler des commandes non récentes"),
(
"perform_commented_operations",