-
Notifications
You must be signed in to change notification settings - Fork 2
Issue #129: Updated payment method display in the profile registrations list, added a method column to the Payment model, updated save payment code for registration and membership features.
#131
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
base: main
Are you sure you want to change the base?
Conversation
…ns list, added a `method` column to the `Payment` model, updated save payment code for registration and membership features.
83464c8 to
3d505e3
Compare
dds_registration/models.py
Outdated
| ] | ||
| DEFAULT_METHOD = "INVOICE" | ||
|
|
||
| method = models.TextField(choices=METHODS, default=DEFAULT_METHOD) |
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.
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.
I don't agree with this (hiding data in hard-to-access entities isn't a good coding approach), but ok: going to create helpers to extract them from there.
| "type": form.cleaned_data["membership_type"], | ||
| }, | ||
| "method": form.cleaned_data["payment_method"], | ||
| "method": payment_method, |
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.
What is the idea behind this change? You create a variable to only use it once. I suggest reverting this change.
| <td class="col-payment"> | ||
| {% if payment %} | ||
| {{ payment.get_payment_method_display }} | ||
| {{ payment.get_method_display }} |
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.
We can add a method to Payment if this needs to be displayed differently that it is stored. I want to keep all the info in data.
7c0b8e9 to
e7f7280
Compare
| # invoice or a receipt | ||
| data = models.JSONField(help_text="Read-only JSON object", default=dict) | ||
|
|
||
| def get_data(self): |
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.
No JSON anything is needed, all of that is done automatically. You are making this much more complicated than it needs to be. Please see #133 for a clean way to fix this issue.
No description provided.