Skip to content

Conversation

@uds5501
Copy link
Contributor

@uds5501 uds5501 commented Jul 26, 2019

Fixes #6240

Short description of what this resolves:

Add tax information for the events being copied.

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.

@auto-label auto-label bot added the fix label Jul 26, 2019
kushthedude
kushthedude previously approved these changes Jul 26, 2019
@codecov
Copy link

codecov bot commented Jul 26, 2019

Codecov Report

Merging #6241 into development will increase coverage by 0.17%.
The diff coverage is 7.14%.

Impacted file tree graph

@@               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
Impacted Files Coverage Δ
app/api/event_copy.py 29.57% <7.14%> (+11.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7dd5282...3137fb3. Read the comment docs.

@uds5501 uds5501 requested a review from iamareebjamal July 27, 2019 07:01
@fossasia fossasia deleted a comment Jul 27, 2019
make_transient(tax)
tax.event_id = event.id
delattr(tax, 'id')
save_to_db(tax)
Copy link
Member

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

@fossasia fossasia deleted a comment Jul 27, 2019
@uds5501 uds5501 requested a review from iamareebjamal July 27, 2019 11:40
expunge_object(code, event)

for form in custom_forms:
form_id = form.id
Copy link
Member

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?

Copy link
Member

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?

sponsor_logos_url_task.delay(event_id=event_id)


def expunge_object(object, event):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def expunge_object(object, event):
def copy_to_event(object, event):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal
Copy link
Member

iamareebjamal commented Jul 27, 2019

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

@fossasia fossasia deleted a comment Jul 27, 2019
@uds5501 uds5501 requested a review from kushthedude July 27, 2019 16:28
Copy link
Member

@kushthedude kushthedude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready for merge

@iamareebjamal iamareebjamal merged commit 5563826 into fossasia:development Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tax information not being carried on event copy action

5 participants