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
8c3f8a31
Commit
8c3f8a31
authored
Feb 20, 2019
by
Luko van der Maas
Browse files
Merge branch 'fix/migration-events' into 'master'
Fix events payments migration See merge request
!1172
parents
ab6161dc
6dd104ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/events/migrations/0034_registration_payment_obj.py
View file @
8c3f8a31
...
...
@@ -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