Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pole-Web
Website
Commits
103d91a7
Commit
103d91a7
authored
Oct 23, 2021
by
VAN ZUIJLEN Nils
Committed by
VAN ZUIJLEN Nils
Apr 28, 2022
Browse files
Invalid member list cache on new contributions
Signed-off-by:
Nils VAN ZUIJLEN
<
nils.van-zuijlen@mailo.com
>
parent
8789a0f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
bde/models.py
View file @
103d91a7
...
...
@@ -4,6 +4,8 @@ from typing import Tuple
from
django.conf
import
settings
from
django.db
import
models
from
core.cache
import
invalid_cache
CONTRIBUTION_TYPES
=
[
(
"half"
,
"Demi-cotisation"
),
...
...
@@ -31,6 +33,8 @@ class Contributor(models.Model):
else
:
end_date
=
datetime
.
date
(
now
.
year
,
12
,
31
)
invalid_cache
(
"members"
)
return
Contributor
.
objects
.
update_or_create
(
{
"end_date"
:
end_date
,
"type"
:
"half"
,
"means_of_payment"
:
mean
},
user
=
user
)
...
...
@@ -45,6 +49,8 @@ class Contributor(models.Model):
else
:
end_date
=
datetime
.
date
(
now
.
year
+
1
,
6
,
30
)
invalid_cache
(
"members"
)
return
Contributor
.
objects
.
update_or_create
(
{
"end_date"
:
end_date
,
"type"
:
"full"
,
"means_of_payment"
:
mean
},
user
=
user
)
...
...
Write
Preview
Supports
Markdown
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