Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-DashboardFeeds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-DashboardFeeds
Commits
38494e9d
Verified
Commit
38494e9d
authored
1 year ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix lint
parent
5a562b2f
No related branches found
No related tags found
1 merge request
!84
Update pyproject.toml
Pipeline
#137905
passed with warnings
1 year ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/dashboardfeeds/models.py
+14
-8
14 additions, 8 deletions
aleksis/apps/dashboardfeeds/models.py
with
14 additions
and
8 deletions
aleksis/apps/dashboardfeeds/models.py
+
14
−
8
View file @
38494e9d
...
...
@@ -33,6 +33,13 @@ class RSSFeedWidget(DashboardWidget):
rss_source
=
models
.
ForeignKey
(
Source
,
on_delete
=
models
.
CASCADE
,
editable
=
False
,
null
=
True
)
class
Meta
:
verbose_name
=
_
(
"
RSS Widget
"
)
verbose_name_plural
=
_
(
"
RSS Widgets
"
)
def
__str__
(
self
):
return
self
.
title
def
save
(
self
,
*
args
,
**
kwargs
):
# Update the linked RSS source object to transfer data into django-feeds
if
not
self
.
rss_source
:
...
...
@@ -62,10 +69,6 @@ class RSSFeedWidget(DashboardWidget):
}
return
feed
class
Meta
:
verbose_name
=
_
(
"
RSS Widget
"
)
verbose_name_plural
=
_
(
"
RSS Widgets
"
)
@receiver
(
post_delete
,
sender
=
RSSFeedWidget
)
def
delete_rss_source_reverse
(
sender
,
**
kwargs
):
...
...
@@ -87,6 +90,13 @@ class ICalFeedWidget(DashboardWidget):
)
events_count
=
models
.
IntegerField
(
verbose_name
=
_
(
"
Number of displayed events
"
),
default
=
5
)
class
Meta
:
verbose_name
=
_
(
"
iCalendar Widget
"
)
verbose_name_plural
=
_
(
"
iCalendar Widgets
"
)
def
__str__
(
self
):
return
self
.
title
def
get_context
(
self
,
request
):
try
:
events
=
get_current_events_with_cal
(
self
.
url
,
self
.
events_count
)
...
...
@@ -103,7 +113,3 @@ class ICalFeedWidget(DashboardWidget):
"
feed_events
"
:
events
,
}
return
feed
class
Meta
:
verbose_name
=
_
(
"
iCalendar Widget
"
)
verbose_name_plural
=
_
(
"
iCalendar Widgets
"
)
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