From dec4e77430c2acd47ba7b368a36d0945d46bcd00 Mon Sep 17 00:00:00 2001
From: Valentin Rigal <rigal@teklia.com>
Date: Tue, 11 Feb 2025 16:47:31 +0100
Subject: [PATCH] Declare Budget.memberships generic relation

---
 arkindex/budget/models.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arkindex/budget/models.py b/arkindex/budget/models.py
index c9567cb6ad..8d1bd9757e 100644
--- a/arkindex/budget/models.py
+++ b/arkindex/budget/models.py
@@ -1,6 +1,7 @@
 import uuid
 
 from django.conf import settings
+from django.contrib.contenttypes.fields import GenericRelation
 from django.core.validators import MinLengthValidator
 from django.db import models
 
@@ -9,6 +10,7 @@ class Budget(models.Model):
     id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
     name = models.CharField(max_length=100, validators=[MinLengthValidator(1)])
     total = models.DecimalField(max_digits=12, decimal_places=3, default=0)
+    memberships = GenericRelation("users.Right", "content_id")
 
     def __str__(self) -> str:
         return self.name
-- 
GitLab