Skip to content
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

Create a membership history when updating a membership #3301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ivarnakken
Copy link
Member

@ivarnakken ivarnakken commented Apr 17, 2023

Frontend change: webkom/lego-webapp#3805

Tested manually that the creation of membership history works, but I'll write up a quick test for it soon.

Related to ABA-400

@ivarnakken ivarnakken added new-feature Pull requests that introduce or issues that suggest a new feature review-needed Pull requests that need review labels Apr 17, 2023
@codecov
Copy link

codecov bot commented Apr 17, 2023

Codecov Report

Patch coverage: 58.33% and project coverage change: -0.02 ⚠️

Comparison is base (45c2a5b) 88.32% compared to head (2c891a5) 88.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3301      +/-   ##
==========================================
- Coverage   88.32%   88.30%   -0.02%     
==========================================
  Files         661      661              
  Lines       20882    20893      +11     
==========================================
+ Hits        18444    18450       +6     
- Misses       2438     2443       +5     
Impacted Files Coverage Δ
lego/apps/users/views/memberships.py 82.85% <58.33%> (-12.98%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ivarnakken ivarnakken added testing-needed Pull requests that need testing, e.g. stress tests by users or specs do-not-merge/WIP Pull requests that are "work in progress", and should not be merged labels Apr 17, 2023
@@ -1,10 +1,16 @@
from datetime import datetime
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, use django.utils.timzone

Comment on lines +48 to +50
start_date = datetime.strptime(
request.data["membership"]["created_at"], "%Y-%m-%dT%H:%M:%S.%fZ"
)
Copy link
Member

Choose a reason for hiding this comment

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

Do serializer.is_valid() and use the serialized value in the create below and you can throw away this.

@ivarnakken ivarnakken added the changes-requested Pull requests with requested changes label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes-requested Pull requests with requested changes do-not-merge/WIP Pull requests that are "work in progress", and should not be merged new-feature Pull requests that introduce or issues that suggest a new feature review-needed Pull requests that need review testing-needed Pull requests that need testing, e.g. stress tests by users or specs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants