Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
57ed62b7
Commit
57ed62b7
authored
6 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch '1170-job-failed-315563' into 'master'
Resolve "Job Failed #315563" Closes
#1170
See merge request
!1681
parents
430407ab
64997e38
No related branches found
No related tags found
1 merge request
!1681
Resolve "Job Failed #315563"
Pipeline
#194903
failed
6 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/core/mixins.py
+2
-3
2 additions, 3 deletions
aleksis/core/mixins.py
aleksis/core/util/core_helpers.py
+4
-4
4 additions, 4 deletions
aleksis/core/util/core_helpers.py
conftest.py
+3
-3
3 additions, 3 deletions
conftest.py
with
9 additions
and
10 deletions
aleksis/core/mixins.py
+
2
−
3
View file @
57ed62b7
...
...
@@ -21,7 +21,6 @@ from django.views.generic import CreateView, UpdateView
from
django.views.generic.edit
import
DeleteView
,
ModelFormMixin
import
reversion
from
django_ical.feedgenerator
import
ITEM_ELEMENT_FIELD_MAP
from
dynamic_preferences.settings
import
preferences_settings
from
dynamic_preferences.types
import
FilePreference
from
guardian.admin
import
GuardedModelAdmin
...
...
@@ -39,7 +38,7 @@ from aleksis.core.managers import (
SchoolTermRelatedQuerySet
,
)
from
.util.core_helpers
import
ExtendedICal20Feed
from
.util.core_helpers
import
EXTENDED_ITEM_ELEMENT_FIELD_MAP
,
ExtendedICal20Feed
if
TYPE_CHECKING
:
from
.models
import
Person
...
...
@@ -725,7 +724,7 @@ class CalendarEventMixin(RegistryObject):
@classmethod
def
get_event_field_names
(
cls
)
->
list
[
str
]:
"""
Return the names of the fields to be used for the feed.
"""
return
[
field_map
[
0
]
for
field_map
in
ITEM_ELEMENT_FIELD_MAP
]
return
[
field_map
[
0
]
for
field_map
in
EXTENDED_
ITEM_ELEMENT_FIELD_MAP
]
@classmethod
def
get_event_field_value
(
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/util/core_helpers.py
+
4
−
4
View file @
57ed62b7
...
...
@@ -476,8 +476,8 @@ def get_ip(*args, **kwargs):
return
get_client_ip
(
*
args
,
**
kwargs
)[
0
]
feedgenerator
.
FEED_FIELD_MAP
=
feedgenerator
.
FEED_FIELD_MAP
+
((
"
color
"
,
"
color
"
),)
feedgenerator
.
ITEM_ELEMENT_FIELD_MAP
=
feedgenerator
.
ITEM_ELEMENT_FIELD_MAP
+
(
EXTENDED_
FEED_FIELD_MAP
=
feedgenerator
.
FEED_FIELD_MAP
+
((
"
color
"
,
"
color
"
),)
EXTENDED_
ITEM_ELEMENT_FIELD_MAP
=
feedgenerator
.
ITEM_ELEMENT_FIELD_MAP
+
(
(
"
color
"
,
"
color
"
),
(
"
meta
"
,
"
x-meta
"
),
(
"
reference_object
"
,
"
reference_object
"
),
...
...
@@ -496,7 +496,7 @@ class ExtendedICal20Feed(feedgenerator.ICal20Feed):
cal
.
add
(
"
calscale
"
,
"
GREGORIAN
"
)
cal
.
add
(
"
prodid
"
,
"
-//AlekSIS//AlekSIS//EN
"
)
for
ifield
,
efield
in
feedgenerator
.
FEED_FIELD_MAP
:
for
ifield
,
efield
in
EXTENDED_
FEED_FIELD_MAP
:
val
=
self
.
feed
.
get
(
ifield
)
if
val
is
not
None
:
cal
.
add
(
efield
,
val
)
...
...
@@ -518,7 +518,7 @@ class ExtendedICal20Feed(feedgenerator.ICal20Feed):
component_type
=
item
.
get
(
"
component_type
"
)
element
=
Todo
()
if
component_type
==
"
todo
"
else
Event
()
for
ifield
,
efield
in
feedgenerator
.
ITEM_ELEMENT_FIELD_MAP
:
for
ifield
,
efield
in
EXTENDED_
ITEM_ELEMENT_FIELD_MAP
:
val
=
item
.
get
(
ifield
)
if
val
is
not
None
:
if
ifield
==
"
attendee
"
:
...
...
This diff is collapsed.
Click to expand it.
conftest.py
+
3
−
3
View file @
57ed62b7
...
...
@@ -30,15 +30,15 @@ def graphql_query(
header_params
=
{
"
headers
"
:
headers
}
resp
=
client
.
post
(
graphql_url
,
json
.
dumps
(
[
body
]
),
json
.
dumps
(
body
),
content_type
=
"
application/json
"
,
**
header_params
,
)
else
:
resp
=
client
.
post
(
graphql_url
,
json
.
dumps
(
[
body
]
),
content_type
=
"
application/json
"
graphql_url
,
json
.
dumps
(
body
),
content_type
=
"
application/json
"
)
content
=
json
.
loads
(
resp
.
content
)
[
0
]
content
=
json
.
loads
(
resp
.
content
)
return
resp
,
content
...
...
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