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
043965d2
Verified
Commit
043965d2
authored
1 year ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' into develop
parents
3ecd62a9
edb655bc
No related branches found
No related tags found
1 merge request
!29
Use docker main tag
Pipeline
#7086
passed
1 year ago
Stage: build
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+6
-6
6 additions, 6 deletions
Dockerfile
Makefile
+1
-1
1 addition, 1 deletion
Makefile
program/serializers.py
+21
-21
21 additions, 21 deletions
program/serializers.py
program/views.py
+6
-1
6 additions, 1 deletion
program/views.py
with
34 additions
and
29 deletions
Dockerfile
+
6
−
6
View file @
043965d2
...
...
@@ -24,12 +24,6 @@ COPY . .
VOLUME
["/app"]
RUN
adduser
--home
/app
--no-create-home
--system
--uid
${
AURA_UID
}
--group
app
RUN
mkdir
-p
/app/logs
RUN
chown
-R
app:app /app
USER
app
# run with Django's development server
CMD
["run.dev"]
...
...
@@ -37,6 +31,12 @@ FROM base AS prod
COPY
. .
RUN
adduser
--home
/app
--no-create-home
--system
--uid
${
AURA_UID
}
--group
app
RUN
mkdir
-p
/app/logs
RUN
mkdir
-p
/app/static/admin
RUN
chown
-R
app:app /app
USER
app
# run with gunicorn
CMD
["run.prod"]
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
1
−
1
View file @
043965d2
...
...
@@ -18,7 +18,7 @@ create_oidc_client.dashboard:
create_oidc_client.tank
:
$(
POETRY_RUN_MANAGE
)
create_oidc_client tank confidential
--client-id
${
TANK_OIDC_CLIENT_ID
}
--client-secret
${
TANK_OIDC_CLIENT_SECRET
}
-r
"code"
-u
${
TANK_CALLBACK_BASE_URL
}
/tank/auth/oidc/callback
initialize
:
migrate loaddata.program create_oidc_client.dashboard create_oidc_client.tank
initialize
:
migrate
collectstatic
loaddata.program create_oidc_client.dashboard create_oidc_client.tank
$(
POETRY_RUN_MANAGE
)
createsuperuser
--no-input
$(
POETRY_RUN_MANAGE
)
creatersakey
...
...
This diff is collapsed.
Click to expand it.
program/serializers.py
+
21
−
21
View file @
043965d2
...
...
@@ -548,22 +548,23 @@ class ShowSerializer(serializers.HyperlinkedModelSerializer):
instance
.
slug
=
validated_data
.
get
(
"
slug
"
,
instance
.
slug
)
instance
.
type
=
validated_data
.
get
(
"
type_id
"
,
instance
.
type
)
if
category
:
=
validated_data
.
get
(
"
category
"
):
# optional many-to-many in PATCH requests
if
(
category
:
=
validated_data
.
get
(
"
category
"
))
is
not
None
:
instance
.
category
.
set
(
category
)
if
hosts
:
=
validated_data
.
get
(
"
hosts
"
):
if
(
hosts
:
=
validated_data
.
get
(
"
hosts
"
)
)
is
not
None
:
instance
.
hosts
.
set
(
hosts
)
if
language
:
=
validated_data
.
get
(
"
language
"
):
if
(
language
:
=
validated_data
.
get
(
"
language
"
)
)
is
not
None
:
instance
.
language
.
set
(
language
)
if
music_focus
:
=
validated_data
.
get
(
"
music_focus
"
):
if
(
music_focus
:
=
validated_data
.
get
(
"
music_focus
"
)
)
is
not
None
:
instance
.
music_focus
.
set
(
music_focus
)
if
owners
:
=
validated_data
.
get
(
"
owners
"
):
if
(
owners
:
=
validated_data
.
get
(
"
owners
"
)
)
is
not
None
:
instance
.
owners
.
set
(
owners
)
if
topic
:
=
validated_data
.
get
(
"
topic
"
):
if
(
topic
:
=
validated_data
.
get
(
"
topic
"
)
)
is
not
None
:
instance
.
topic
.
set
(
topic
)
if
links_data
:
=
validated_data
.
get
(
"
links
"
):
...
...
@@ -779,7 +780,6 @@ class TimeSlotSerializer(serializers.ModelSerializer):
instance
.
repetition_of
=
validated_data
.
get
(
"
repetition_of_id
"
,
instance
.
repetition_of
)
instance
.
playlist_id
=
validated_data
.
get
(
"
playlist_id
"
,
instance
.
playlist_id
)
instance
.
save
()
return
instance
...
...
@@ -790,17 +790,15 @@ class NoteLinkSerializer(serializers.ModelSerializer):
fields
=
(
"
type
"
,
"
url
"
)
tags_json_schema
=
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}
}
tags_json_schema
=
{
"
type
"
:
"
array
"
,
"
items
"
:
{
"
type
"
:
"
string
"
}}
class
NoteSerializer
(
serializers
.
ModelSerializer
):
contributor_ids
=
serializers
.
PrimaryKeyRelatedField
(
many
=
True
,
queryset
=
Host
.
objects
.
all
(),
required
=
False
,
source
=
"
contributors
"
,
many
=
True
,
queryset
=
Host
.
objects
.
all
(),
required
=
False
,
source
=
"
contributors
"
,
)
image_id
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
Image
.
objects
.
all
(),
required
=
False
,
allow_null
=
True
...
...
@@ -864,6 +862,7 @@ class NoteSerializer(serializers.ModelSerializer):
show
=
validated_data
[
"
timeslot
"
].
schedule
.
show
# we derive `contributors`, `language` and `topic` from the Show's values if not set
contributors
=
validated_data
.
pop
(
"
contributors
"
,
show
.
owners
.
values_list
(
"
id
"
,
flat
=
True
))
language
=
validated_data
.
pop
(
"
language
"
,
show
.
language
.
values_list
(
"
id
"
,
flat
=
True
))
topic
=
validated_data
.
pop
(
"
topic
"
,
show
.
topic
.
values_list
(
"
id
"
,
flat
=
True
))
...
...
@@ -905,9 +904,16 @@ class NoteSerializer(serializers.ModelSerializer):
instance
.
tags
=
validated_data
.
get
(
"
tags
"
,
instance
.
tags
)
instance
.
title
=
validated_data
.
get
(
"
title
"
,
instance
.
title
)
if
contributors
:
=
validated_data
.
get
(
"
contributors
"
,
[]):
# optional many-to-many in PATCH requests
if
(
contributors
:
=
validated_data
.
get
(
"
contributors
"
))
is
not
None
:
instance
.
contributors
.
set
(
contributors
)
if
(
language
:
=
validated_data
.
get
(
"
language
"
))
is
not
None
:
instance
.
language
.
set
(
language
)
if
(
topic
:
=
validated_data
.
get
(
"
topic
"
))
is
not
None
:
instance
.
topic
.
set
(
topic
)
if
cba_id
:
=
validated_data
.
get
(
"
cba_id
"
):
if
audio_url
:
=
get_audio_url
(
cba_id
):
NoteLink
.
objects
.
create
(
note
=
instance
,
type
=
"
CBA
"
,
url
=
audio_url
)
...
...
@@ -918,12 +924,6 @@ class NoteSerializer(serializers.ModelSerializer):
for
link_data
in
links_data
:
NoteLink
.
objects
.
create
(
note
=
instance
,
**
link_data
)
if
language
:
=
validated_data
.
get
(
"
language
"
,
[]):
instance
.
language
.
set
(
language
)
if
topic
:
=
validated_data
.
get
(
"
topic
"
,
[]):
instance
.
topic
.
set
(
topic
)
instance
.
updated_by
=
self
.
context
.
get
(
"
request
"
).
user
.
username
instance
.
save
()
...
...
This diff is collapsed.
Click to expand it.
program/views.py
+
6
−
1
View file @
043965d2
...
...
@@ -33,7 +33,7 @@ from rest_framework.pagination import LimitOffsetPagination
from
rest_framework.response
import
Response
from
django.contrib.auth.models
import
User
from
django.http
import
Http404
,
HttpResponse
from
django.http
import
Http404
,
HttpResponse
,
JsonResponse
from
django.shortcuts
import
get_object_or_404
from
django.utils
import
timezone
from
django.utils.translation
import
gettext
as
_
...
...
@@ -457,6 +457,7 @@ class APIRRuleViewSet(viewsets.ModelViewSet):
(`one-solution-per-conflict`). Only one solution is allowed per conflict,
so you either offered too many or not enough solutions for any reported
conflicts.
* The referenced recurrence rule does not exist.
"""
),
),
...
...
@@ -561,6 +562,10 @@ class APIScheduleViewSet(
try
:
resolution
=
resolve_conflicts
(
request
.
data
,
pk
,
show_pk
)
# FIXME: Find a better way to do this.
# The exception is thrown by the instantiate_upcoming_schedule function.
except
RRule
.
DoesNotExist
as
exc
:
return
JsonResponse
({
"
rruleId
"
:
str
(
exc
)},
status
=
status
.
HTTP_400_BAD_REQUEST
)
except
ScheduleConflictError
as
exc
:
return
Response
(
exc
.
conflicts
,
status
.
HTTP_409_CONFLICT
)
...
...
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