Bug: Issue with currency model, affecting accounts updating. #58

Closed
opened 2025-12-28 23:24:58 +01:00 by adam · 1 comment
Owner

Originally created by @samuelthng on GitHub (Sep 8, 2025).

Originally assigned to: @eitchtee on GitHub.

Bug with updating account information, trying to update an account's name or account group throws 500 on the UI.

My gut says it might be from this PR but I'm not really sure.
Not familiar with Django.

Probably useless - Screenshot Image
Error log from server
[2025-09-08 12:47:27] - ERROR - django.request - Internal Server Error: /account/1/edit/
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/src/app/apps/common/decorators/htmx.py", line 12, in _view
    return view(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper
    return view_func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/views/decorators/http.py", line 64, in inner
    return func(request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/src/app/apps/accounts/views/accounts.py", line 79, in account_edit
    if form.is_valid():
       ^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 206, in is_valid
    return self.is_bound and not self.errors
                                 ^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 201, in errors
    self.full_clean()

  File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 337, in full_clean
    self._clean_fields()

  File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 345, in _clean_fields
    self.cleaned_data[name] = field._clean_bound_field(bf)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/forms/fields.py", line 273, in _clean_bound_field
    return self.clean(value)
           ^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/forms/fields.py", line 208, in clean
    value = self.to_python(value)
            ^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/forms/models.py", line 1564, in to_python
    value = self.queryset.get(**{key: value})
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 636, in get
    raise self.model.MultipleObjectsReturned(

apps.currencies.models.Currency.MultipleObjectsReturned: get() returned more than one Currency -- it returned 10!
Originally created by @samuelthng on GitHub (Sep 8, 2025). Originally assigned to: @eitchtee on GitHub. Bug with updating account information, trying to update an account's name or account group throws 500 on the UI. My gut says it might be from [this PR](https://github.com/eitchtee/WYGIWYH/pull/352) but I'm not really sure. Not familiar with Django. <details><summary>Probably useless - Screenshot</summary> <img width="1119" height="1497" alt="Image" src="https://github.com/user-attachments/assets/e6e9a362-2297-4020-966a-86733ec170c9" /> </details> <details><summary>Error log from server</summary> ```py [2025-09-08 12:47:27] - ERROR - django.request - Internal Server Error: /account/1/edit/ Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/apps/common/decorators/htmx.py", line 12, in _view return view(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/contrib/auth/decorators.py", line 59, in _view_wrapper return view_func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/views/decorators/http.py", line 64, in inner return func(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/app/apps/accounts/views/accounts.py", line 79, in account_edit if form.is_valid(): ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 206, in is_valid return self.is_bound and not self.errors ^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 201, in errors self.full_clean() File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 337, in full_clean self._clean_fields() File "/usr/local/lib/python3.11/site-packages/django/forms/forms.py", line 345, in _clean_fields self.cleaned_data[name] = field._clean_bound_field(bf) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/forms/fields.py", line 273, in _clean_bound_field return self.clean(value) ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/forms/fields.py", line 208, in clean value = self.to_python(value) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/forms/models.py", line 1564, in to_python value = self.queryset.get(**{key: value}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/django/db/models/query.py", line 636, in get raise self.model.MultipleObjectsReturned( apps.currencies.models.Currency.MultipleObjectsReturned: get() returned more than one Currency -- it returned 10! ``` </details>
adam added the bug label 2025-12-28 23:24:58 +01:00
adam closed this issue 2025-12-28 23:24:59 +01:00
Author
Owner

@eitchtee commented on GitHub (Sep 8, 2025):

Thanks for bringing this to my attention. I'm releasing v0.17.3 with a quick fix for this issue.

@eitchtee commented on GitHub (Sep 8, 2025): Thanks for bringing this to my attention. I'm releasing v0.17.3 with a quick fix for this issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WYGIWYH#58