fix project create api
This commit is contained in:
@@ -8,10 +8,10 @@ class Command(BaseCommand):
|
||||
|
||||
def handle(self, *args, **options):
|
||||
permissions = [
|
||||
{"code": "can_see_product_wherehouse", "name": "permission for see wherehouse list"},
|
||||
{"code": "project", "name": "project all access"},
|
||||
{
|
||||
"code": "can_add_product_wherehouse",
|
||||
"name": "permission for add product in wherehouse"
|
||||
"code": "project_folder",
|
||||
"name": "project folder all access"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
18
core/apps/accounts/migrations/0003_alter_role_permissions.py
Normal file
18
core/apps/accounts/migrations/0003_alter_role_permissions.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.4 on 2025-08-05 10:04
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0002_permission_role_user_role'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='role',
|
||||
name='permissions',
|
||||
field=models.ManyToManyField(blank=True, related_name='roles', to='accounts.permission'),
|
||||
),
|
||||
]
|
||||
@@ -7,7 +7,7 @@ from core.apps.accounts.models.permission import Permission
|
||||
|
||||
class Role(BaseModel):
|
||||
name = models.CharField(max_length=200, unique=True)
|
||||
permissions = models.ManyToManyField(Permission, related_name='roles')
|
||||
permissions = models.ManyToManyField(Permission, related_name='roles', blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
Reference in New Issue
Block a user