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
6dd104ef
Verified
Commit
6dd104ef
authored
Feb 20, 2019
by
Sébastiaan Versteeg
Browse files
Fix events payments migration
parent
ab6161dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/events/migrations/0034_registration_payment_obj.py
View file @
6dd104ef
...
...
@@ -16,15 +16,18 @@ class Migration(migrations.Migration):
db_alias
=
schema_editor
.
connection
.
alias
for
reg
in
Registration
.
objects
.
using
(
db_alias
).
all
():
if
reg
.
event
.
price
>
0
and
reg
.
payment_str
!=
'no_payment'
:
notes
=
f
'Event registration
{
reg
.
event
.
title_en
}
. '
if
reg
.
name
:
notes
+=
f
'Paid by
{
reg
.
name
}
. '
notes
+=
(
f
'
{
reg
.
event
.
start
}
. '
f
'Registration date:
{
reg
.
date
}
.'
)
reg
.
payment
=
Payment
.
objects
.
create
(
created_at
=
reg
.
date
,
type
=
reg
.
payment_str
,
amount
=
reg
.
event
.
price
,
paid_by
=
reg
.
member
,
processing_date
=
reg
.
event
.
start
,
notes
=
f
'Event registration
{
reg
.
event
.
title_en
}
'
f
'
{
reg
.
event
.
start
}
. '
f
'Registration:
{
reg
.
date
}
'
notes
=
notes
)
reg
.
save
()
...
...
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