Skip to content
Snippets Groups Projects
Commit 9a1b8b24 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Remove static methos no longer needed

parent 5c34d059
No related branches found
No related tags found
No related merge requests found
...@@ -116,19 +116,6 @@ class Host(models.Model): ...@@ -116,19 +116,6 @@ class Host(models.Model):
for size in THUMBNAIL_SIZES: for size in THUMBNAIL_SIZES:
self.image.thumbnail = self.image.crop[size].name 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): class Link(models.Model):
host = models.ForeignKey(Host, on_delete=models.CASCADE, related_name='links') host = models.ForeignKey(Host, on_delete=models.CASCADE, related_name='links')
...@@ -166,19 +153,6 @@ class Show(models.Model): ...@@ -166,19 +153,6 @@ class Show(models.Model):
class Meta: class Meta:
ordering = ('slug',) 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): class RRule(models.Model):
name = models.CharField(max_length=32, unique=True) name = models.CharField(max_length=32, unique=True)
...@@ -918,18 +892,3 @@ class Note(models.Model): ...@@ -918,18 +892,3 @@ class Note(models.Model):
if self.image.name and THUMBNAIL_SIZES: if self.image.name and THUMBNAIL_SIZES:
for size in THUMBNAIL_SIZES: for size in THUMBNAIL_SIZES:
self.image.thumbnail = self.image.crop[size].name 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment