From 9a1b8b2423d38ea0d397ff0a604bad06175462b5 Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Mon, 14 Mar 2022 18:06:00 -0400
Subject: [PATCH] Remove static methos no longer needed

---
 program/models.py | 41 -----------------------------------------
 1 file changed, 41 deletions(-)

diff --git a/program/models.py b/program/models.py
index f0f0df2b..25257296 100644
--- a/program/models.py
+++ b/program/models.py
@@ -116,19 +116,6 @@ class Host(models.Model):
             for size in THUMBNAIL_SIZES:
                 self.image.thumbnail = self.image.crop[size].name
 
-    # FIXME: this does not belong here
-    @staticmethod
-    def is_editable(host_view_set, host_id):
-        """
-        Whether the given host is assigned to a show the current user owns
-        @return boolean
-        """
-        if host_view_set.request.user.is_superuser:
-            return True
-
-        host_ids = Host.objects.filter(shows__in=host_view_set.request.user.shows.all()).distinct().values_list('id', flat=True)
-        return int(host_id) in host_ids
-
 
 class Link(models.Model):
     host = models.ForeignKey(Host, on_delete=models.CASCADE, related_name='links')
@@ -166,19 +153,6 @@ class Show(models.Model):
     class Meta:
         ordering = ('slug',)
 
-    # FIXME: this does not belong here
-    @staticmethod
-    def is_editable(show_view_set, show_id):
-        """
-        Whether the current user is owner of the given show
-        @return boolean
-        """
-        if show_view_set.request.user.is_superuser:
-            return True
-
-        show_ids = show_view_set.request.user.shows.all().values_list('id', flat=True)
-        return int(show_id) in show_ids
-
 
 class RRule(models.Model):
     name = models.CharField(max_length=32, unique=True)
@@ -918,18 +892,3 @@ class Note(models.Model):
         if self.image.name and THUMBNAIL_SIZES:
             for size in THUMBNAIL_SIZES:
                 self.image.thumbnail = self.image.crop[size].name
-
-    # FIXME: this does not belong here
-    @staticmethod
-    def is_editable(note_view_set, note_id):
-        """
-        Whether the given note is assigned to a show the current user owns
-        @return boolean
-        """
-
-        if note_view_set.request.user.is_superuser:
-            return True
-
-        note = Note.objects.get(pk=note_id)
-
-        return int(note.show_id) in note_view_set.request.user.shows.all().values_list('id', flat=True)
-- 
GitLab