Type error on eco account edit #238

Closed
opened 2022-11-18 12:40:59 +01:00 by mpeltriaux · 1 comment
Owner

Status quo

A new bug has been detected:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/konova/konova/decorators.py", line 80, in wrap
    return function(request, *args, **kwargs)
  File "/konova/konova/decorators.py", line 147, in wrap
    return function(request, *args, **kwargs)
  File "/konova/compensation/views/eco_account/eco_account.py", line 148, in edit_view
    acc = data_form.save(request.user, geom_form)
  File "/konova/compensation/forms/eco_account.py", line 216, in save
    self.instance.update_deductable_rest()
  File "/konova/compensation/models/eco_account.py", line 191, in update_deductable_rest
    self.deductable_rest = self.__calculate_deductable_rest()
  File "/konova/compensation/models/eco_account.py", line 122, in __calculate_deductable_rest
    ret_val = available_surfaces - deductions_surfaces

Exception Type: TypeError at /compensation/acc/1445e3ee-693e-48ff-9e29-a696707f41f3/edit
Exception Value: unsupported operand type(s) for -: 'decimal.Decimal' and 'float'

Fix this!

# Status quo A new bug has been detected: ``` python Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 179, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python3.7/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view return view_func(request, *args, **kwargs) File "/konova/konova/decorators.py", line 80, in wrap return function(request, *args, **kwargs) File "/konova/konova/decorators.py", line 147, in wrap return function(request, *args, **kwargs) File "/konova/compensation/views/eco_account/eco_account.py", line 148, in edit_view acc = data_form.save(request.user, geom_form) File "/konova/compensation/forms/eco_account.py", line 216, in save self.instance.update_deductable_rest() File "/konova/compensation/models/eco_account.py", line 191, in update_deductable_rest self.deductable_rest = self.__calculate_deductable_rest() File "/konova/compensation/models/eco_account.py", line 122, in __calculate_deductable_rest ret_val = available_surfaces - deductions_surfaces Exception Type: TypeError at /compensation/acc/1445e3ee-693e-48ff-9e29-a696707f41f3/edit Exception Value: unsupported operand type(s) for -: 'decimal.Decimal' and 'float' ``` # Fix this!
mpeltriaux added the
bug
label 2022-11-18 12:41:02 +01:00
mpeltriaux self-assigned this 2022-11-18 12:41:12 +01:00
mpeltriaux referenced this issue from a commit 2022-11-18 13:28:30 +01:00
Author
Owner

Fixed and merged in #239

# Fixed and merged in #239
btuelek referenced this issue from a commit 2024-12-05 13:18:38 +01:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: IT-Naturschutz/konova#238
No description provided.