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
b721d3c4
Verified
Commit
b721d3c4
authored
8 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
feat: rename HostViewset -> ProfileViewset
parent
72ac2272
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/views.py
+16
-16
16 additions, 16 deletions
program/views.py
with
16 additions
and
16 deletions
program/views.py
+
16
−
16
View file @
b721d3c4
...
...
@@ -48,13 +48,13 @@ from program import filters
from
program.models
import
(
Category
,
FundingCategory
,
Host
,
Image
,
Language
,
License
,
LinkType
,
MusicFocus
,
Note
,
Profile
,
RadioSettings
,
RRule
,
Schedule
,
...
...
@@ -68,7 +68,6 @@ from program.serializers import (
CategorySerializer
,
ErrorSerializer
,
FundingCategorySerializer
,
HostSerializer
,
ImageRenderSerializer
,
ImageSerializer
,
LanguageSerializer
,
...
...
@@ -77,6 +76,7 @@ from program.serializers import (
MusicFocusSerializer
,
NoteSerializer
,
PlayoutEntrySerializer
,
ProfileSerializer
,
ProgramEntrySerializer
,
RadioSettingsSerializer
,
RRuleSerializer
,
...
...
@@ -891,22 +891,22 @@ class APILanguageViewSet(ActiveFilterMixin, viewsets.ModelViewSet):
@extend_schema_view
(
create
=
extend_schema
(
summary
=
"
Create a new
host
.
"
),
retrieve
=
extend_schema
(
summary
=
"
Retrieve a single
host
.
"
),
update
=
extend_schema
(
summary
=
"
Update an existing
host
.
"
),
partial_update
=
extend_schema
(
summary
=
"
Partially update an existing
host
.
"
),
destroy
=
extend_schema
(
summary
=
"
Delete an existing
host
.
"
),
list
=
extend_schema
(
summary
=
"
List all
host
s.
"
),
create
=
extend_schema
(
summary
=
"
Create a new
profile
.
"
),
retrieve
=
extend_schema
(
summary
=
"
Retrieve a single
profile
.
"
),
update
=
extend_schema
(
summary
=
"
Update an existing
profile
.
"
),
partial_update
=
extend_schema
(
summary
=
"
Partially update an existing
profile
.
"
),
destroy
=
extend_schema
(
summary
=
"
Delete an existing
profile
.
"
),
list
=
extend_schema
(
summary
=
"
List all
profile
s.
"
),
)
class
API
Host
ViewSet
(
ActiveFilterMixin
,
viewsets
.
ModelViewSet
):
queryset
=
Host
.
objects
.
all
().
order_by
(
"
-is_active
"
,
"
name
"
)
serializer_class
=
Host
Serializer
class
API
Profile
ViewSet
(
ActiveFilterMixin
,
viewsets
.
ModelViewSet
):
queryset
=
Profile
.
objects
.
all
().
order_by
(
"
-is_active
"
,
"
name
"
)
serializer_class
=
Profile
Serializer
pagination_class
=
LimitOffsetPagination
filter_backends
=
[
drf_filters
.
SearchFilter
]
search_fields
=
[
"
name
"
,
"
email
"
]
def
create
(
self
,
request
,
*
args
,
**
kwargs
):
serializer
=
Host
Serializer
(
serializer
=
Profile
Serializer
(
# FIXME: the method get_serializer_context should be used but it does seem to get lost
context
=
{
"
request
"
:
request
},
# the serializer needs the request in the context
data
=
request
.
data
,
...
...
@@ -917,13 +917,13 @@ class APIHostViewSet(ActiveFilterMixin, viewsets.ModelViewSet):
def
update
(
self
,
request
,
*
args
,
**
kwargs
):
partial
=
kwargs
.
get
(
"
partial
"
,
False
)
host
=
self
.
get_object
()
profile
=
self
.
get_object
()
serializer
=
Host
Serializer
(
serializer
=
Profile
Serializer
(
# FIXME: the method get_serializer_context should be used but it does seem to get lost
context
=
{
"
request
"
:
request
},
# the serializer needs the request in the context
data
=
request
.
data
,
instance
=
host
,
instance
=
profile
,
partial
=
partial
,
)
...
...
@@ -983,8 +983,8 @@ class APILicenseViewSet(viewsets.ModelViewSet):
"
id
"
:
1
,
"
cba
"
:
{
"
domains
"
:
[
"
cba.media
"
]},
"
imageRequirements
"
:
{
"
host.image
"
:
{
"
frame
"
:
{
"
aspectRatio
"
:
[
1
,
1
],
"
shape
"
:
"
round
"
}},
"
note.image
"
:
{
"
frame
"
:
{
"
aspectRatio
"
:
[
16
,
9
],
"
shape
"
:
"
round
"
}},
"
profile.image
"
:
{
"
frame
"
:
{
"
aspectRatio
"
:
[
1
,
1
],
"
shape
"
:
"
round
"
}},
"
show.image
"
:
{
"
frame
"
:
{
"
aspectRatio
"
:
[
16
,
9
],
"
shape
"
:
"
round
"
}},
"
show.logo
"
:
{
"
frame
"
:
{
"
aspectRatio
"
:
[
1
,
1
],
"
shape
"
:
"
round
"
}},
},
...
...
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