From 2b6e28daf0d5397b05f39775f193454cfdded68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Mon, 12 Jun 2017 12:53:46 +0200 Subject: [PATCH] Adding OCC to games --- taiga/projects/api.py | 3 ++- taiga/projects/models.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/taiga/projects/api.py b/taiga/projects/api.py index 8f14f73c..18f5735e 100644 --- a/taiga/projects/api.py +++ b/taiga/projects/api.py @@ -52,6 +52,7 @@ from taiga.projects.mixins.ordering import BulkUpdateOrderMixin from taiga.projects.tasks.models import Task from taiga.projects.tagging.api import TagsColorsResourceMixin from taiga.projects.userstories.models import UserStory, RolePoints +from taiga.projects.occ import OCCResourceMixin from taiga.users import services as users_services from . import filters as project_filters @@ -819,7 +820,7 @@ class InvitationViewSet(ModelListViewSet): raise exc.PermissionDenied(_("You don't have permisions to see that.")) -class GameViewSet(ModelCrudViewSet): +class GameViewSet(OCCResourceMixin, ModelCrudViewSet): model = models.Game serializer_class = serializers.GameSerializer validator_class = validators.GameValidator diff --git a/taiga/projects/models.py b/taiga/projects/models.py index c02e28f3..30a055e1 100644 --- a/taiga/projects/models.py +++ b/taiga/projects/models.py @@ -40,6 +40,7 @@ from taiga.projects.custom_attributes.models import TaskCustomAttribute from taiga.projects.custom_attributes.models import IssueCustomAttribute from taiga.projects.tagging.models import TaggedMixin from taiga.projects.tagging.models import TagsColorsMixin +from taiga.projects.occ import OCCModelMixin from taiga.base.utils.files import get_file_path from taiga.base.utils.slug import slugify_uniquely from taiga.base.utils.slug import slugify_uniquely_for_queryset @@ -1135,7 +1136,7 @@ class ProjectTemplate(TaggedMixin, TagsColorsMixin, models.Model): return project -class Game(models.Model): +class Game(OCCModelMixin, models.Model): uuid = models.CharField(max_length=32, editable=False, null=True, blank=True, default=None, db_index=True) name = models.CharField(max_length=250, null=False, blank=False,