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
4459fa2e
Commit
4459fa2e
authored
3 years ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Beautify code in feeds.py
parent
6d2ce69d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!975
Resolve "Add possibility to create Ical feeds for all apps"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/core/feeds.py
+7
-8
7 additions, 8 deletions
aleksis/core/feeds.py
with
7 additions
and
8 deletions
aleksis/core/feeds.py
+
7
−
8
View file @
4459fa2e
...
...
@@ -16,14 +16,15 @@ class PersonalICalFeedBase(ICalFeed):
@property
def
product_id
(
self
):
lang
=
self
.
request
.
LANGUAGE_CODE
return
f
"
-//AlekSIS®//
{
get_site_preferences
()[
'
general__title
'
]
}
//
{
lang
}
"
title
=
get_site_preferences
()[
'
general__title
'
]
return
f
"
-//AlekSIS//
{
title
}
//
{
lang
}
"
link
=
settings
.
BASE_URL
timezone
=
settings
.
TIME_ZONE
person
=
None
request
=
None
def
get_object
(
self
,
request
:
WSGIRequest
,
*
args
:
Any
,
**
kwargs
:
Any
)
->
None
:
def
get_object
(
self
,
request
,
*
args
,
**
kwargs
)
:
if
kwargs
.
get
(
"
person
"
):
self
.
person
=
kwargs
.
pop
(
"
person
"
)
self
.
request
=
request
...
...
@@ -60,15 +61,13 @@ class BirthdayFeed(PersonalICalFeedBase):
)
def
item_title
(
self
,
item
:
"
models.Person
"
):
return
_
(
"
%(first_name)s %(last_name)s
'
s birthday
"
)
%
{
"
first_name
"
:
item
.
first_name
,
"
last_name
"
:
item
.
last_name
,
return
_
(
"
%(name)s
'
s birthday
"
)
%
{
"
name
"
:
item
.
addressing_name
,
}
def
item_description
(
self
,
item
:
"
models.Person
"
):
return
_
(
"
%(first_name)s %(last_name)s was born on %(birthday)s
"
)
%
{
"
first_name
"
:
item
.
first_name
,
"
last_name
"
:
item
.
last_name
,
return
_
(
"
%(name)s was born on %(birthday)s
"
)
%
{
"
name
"
:
item
.
addressing_name
,
"
birthday
"
:
date_format
(
item
.
date_of_birth
),
}
...
...
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