Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
9a1b8b24
Commit
9a1b8b24
authored
3 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Remove static methos no longer needed
parent
5c34d059
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/models.py
+0
-41
0 additions, 41 deletions
program/models.py
with
0 additions
and
41 deletions
program/models.py
+
0
−
41
View file @
9a1b8b24
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment