Remove unused permission
This commit is contained in:
parent
63738e8e02
commit
93d283fecb
2 changed files with 30 additions and 4 deletions
30
kfet/migrations/0077_delete_frozen_permission.py
Normal file
30
kfet/migrations/0077_delete_frozen_permission.py
Normal 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",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
},
|
||||||
|
),
|
||||||
|
]
|
|
@ -180,9 +180,6 @@ class Account(models.Model):
|
||||||
return set(), False
|
return set(), False
|
||||||
if self.need_comment:
|
if self.need_comment:
|
||||||
perms.add("kfet.perform_commented_operations")
|
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
|
new_balance = self.balance + amount
|
||||||
if new_balance < 0 and amount < 0:
|
if new_balance < 0 and amount < 0:
|
||||||
# Retrieving overdraft amount limit
|
# Retrieving overdraft amount limit
|
||||||
|
@ -726,7 +723,6 @@ class Operation(models.Model):
|
||||||
permissions = (
|
permissions = (
|
||||||
("perform_deposit", "Effectuer une charge"),
|
("perform_deposit", "Effectuer une charge"),
|
||||||
("perform_negative_operations", "Enregistrer des commandes en négatif"),
|
("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"),
|
("cancel_old_operations", "Annuler des commandes non récentes"),
|
||||||
(
|
(
|
||||||
"perform_commented_operations",
|
"perform_commented_operations",
|
||||||
|
|
Loading…
Reference in a new issue