Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-emissions
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-emissions
Commits
489a6b93
Commit
489a6b93
authored
Nov 10, 2019
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add special case for daily program with same-day rerun
parent
eb1d9047
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
emissions/forms.py
emissions/forms.py
+6
-1
emissions/models.py
emissions/models.py
+3
-0
No files found.
emissions/forms.py
View file @
489a6b93
...
...
@@ -184,7 +184,12 @@ class EpisodeNewForm(EpisodeForm):
def
get_diffusion_fields
(
self
,
emission
):
if
emission
:
schedules
=
Schedule
.
objects
.
filter
(
emission
=
emission
,
rerun
=
True
).
count
()
+
1
schedules
=
list
(
Schedule
.
objects
.
filter
(
emission
=
emission
).
order_by
(
'datetime'
))
if
len
(
schedules
)
>
1
and
schedules
[
0
].
datetime
.
date
()
==
schedules
[
1
].
datetime
.
date
():
# special case for daily program with same-day rerun
schedules
=
2
else
:
schedules
=
len
([
x
for
x
in
schedules
if
x
.
rerun
])
+
1
else
:
schedules
=
1
fields
=
[
'first_diffusion'
]
...
...
emissions/models.py
View file @
489a6b93
...
...
@@ -237,6 +237,9 @@ class Schedule(models.Model, WeekdayMixin):
else
:
return
self
.
emission
.
duration
def
end_datetime
(
self
):
return
self
.
datetime
+
datetime
.
timedelta
(
minutes
=
self
.
get_duration
())
def
match_week
(
self
,
week_no
):
if
week_no
==
4
:
# this is the fifth week of the month, only return True for
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment