Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
00d99502
Commit
00d99502
authored
Jul 04, 2018
by
Luko van der Maas
Browse files
added new automatic lists for all previous boardss
parent
379ae9a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/mailinglists/services.py
View file @
00d99502
from
django.conf
import
settings
from
django.utils
import
timezone
from
activemembers.models
import
CommitteeMembership
,
Mentorship
from
activemembers.models
import
CommitteeMembership
,
Mentorship
,
Board
from
members.models
import
Member
from
utils.snippets
import
datetime_to_lectureyear
...
...
@@ -52,6 +52,20 @@ def get_automatic_lists():
profile__receive_optin
=
True
),
multilingual
=
True
)
for
year
in
range
(
Board
.
objects
.
earliest
(
'since'
).
since
.
year
,
lectureyear
):
board
=
Board
.
objects
.
get
(
since__year
=
year
)
if
board
is
not
None
:
lists
+=
_create_automatic_list
(
[
'bestuur'
+
str
(
board
.
since
.
year
)[
-
2
:]
+
str
(
board
.
until
.
year
)[
-
2
:],
'board'
+
str
(
board
.
since
.
year
)[
-
2
:]
+
str
(
board
.
until
.
year
)[
-
2
:]],
''
,
[
x
.
member
for
x
in
CommitteeMembership
.
objects
.
filter
(
committee
=
board
).
prefetch_related
(
'member'
)],
archived
=
False
,
moderated
=
False
,
multilingual
=
False
)
return
lists
...
...
Sébastiaan Versteeg
@sversteeg
mentioned in issue
#688 (closed)
·
Sep 01, 2018
mentioned in issue
#688 (closed)
mentioned in issue #688
Toggle commit list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment