-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: add tax information in event copy action #6241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## development #6241 +/- ##
===============================================
+ Coverage 65.69% 65.86% +0.17%
===============================================
Files 286 286
Lines 14529 14494 -35
===============================================
+ Hits 9545 9547 +2
+ Misses 4984 4947 -37
Continue to review full report at Codecov.
|
app/api/event_copy.py
Outdated
| make_transient(tax) | ||
| tax.event_id = event.id | ||
| delattr(tax, 'id') | ||
| save_to_db(tax) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a function for these 5 lines and reuse
| expunge_object(code, event) | ||
|
|
||
| for form in custom_forms: | ||
| form_id = form.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uds5501 you missed the first step in the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is unneeded. I don't see form_id being used anywhere?
app/api/event_copy.py
Outdated
| sponsor_logos_url_task.delay(event_id=event_id) | ||
|
|
||
|
|
||
| def expunge_object(object, event): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| def expunge_object(object, event): | |
| def copy_to_event(object, event): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamareebjamal Done.
|
Also, calling save_to_db in for loop is not a good idea. Open an issue to optimize this. So that it only gets called once i.e., Objects are added to session but only committed once |
kushthedude
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for merge
Fixes #6240
Short description of what this resolves:
Add tax information for the events being copied.
Checklist
developmentbranch.