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
22b7c2ef
Commit
22b7c2ef
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
CLean up utility code
parent
01b9f7a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/dashboardfeeds/util/event_feed.py
+5
-7
5 additions, 7 deletions
aleksis/apps/dashboardfeeds/util/event_feed.py
with
5 additions
and
7 deletions
aleksis/apps/dashboardfeeds/util/event_feed.py
+
5
−
7
View file @
22b7c2ef
import
logging
import
re
import
requests
from
django.utils
import
timezone
,
formats
from
django.core.cache
import
cache
from
ics
import
Calendar
from
requests
import
RequestException
import
logging
import
requests
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -73,14 +73,12 @@ def get_current_events_with_cal(calendar_url: str, limit: int = 5) -> list:
# Return the if so
return
current_events
# Else
# Get ICS
try
:
calendar
:
Calendar
=
Calendar
(
requests
.
get
(
calendar_url
,
timeout
=
3
).
text
)
except
RequestException
as
e
:
except
requests
.
RequestException
as
e
:
logger
.
error
(
str
(
e
))
return
cache
.
get
(
"
current_events
"
,
[]
)
return
[]
# Get events
current_events
=
get_current_events
(
calendar
,
limit
)
...
...
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