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

Fout bij toevoegen/wijzigen energiecontract zonder einddatum #1094

Closed
gnissahr opened this issue Aug 31, 2020 · 5 comments
Closed

Fout bij toevoegen/wijzigen energiecontract zonder einddatum #1094

gnissahr opened this issue Aug 31, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@gnissahr
Copy link

gnissahr commented Aug 31, 2020

DSMR-reader versie: 4.3
Type RaspberryPi of server: Proxmox LXC container, Debian 10
Standaardinstallatie of Docker: standaard
DSMR-protocol slimme meter v4/v5: v5

Na het updaten naar versie 4.3 geprobeerd om de dagprijs voor electra toe te voegen. Maar kan niets aanpassen. Ook het aanmaken van een nieuw contract lukt niet.

Hieronder de foutmelding:

Server Error
Sorry, something unexpected happened.
Exception:
ValueError: Cannot use None as a query value
Traceback:
  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/contrib/admin/options.py", line 614, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/contrib/admin/sites.py", line 233, in inner
    return view(request, *args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/contrib/admin/options.py", line 1653, in add_view
    return self.changeform_view(request, None, form_url, extra_context)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/utils/decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/utils/decorators.py", line 130, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/contrib/admin/options.py", line 1534, in changeform_view
    return self._changeform_view(request, object_id, form_url, extra_context)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/contrib/admin/options.py", line 1573, in _changeform_view
    form_validated = form.is_valid()

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/forms/forms.py", line 177, in is_valid
    return self.is_bound and not self.errors

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/forms/forms.py", line 172, in errors
    self.full_clean()

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/forms/forms.py", line 375, in full_clean
    self._clean_form()

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/forms/forms.py", line 402, in _clean_form
    cleaned_data = self.clean()

  File "/home/dsmr/dsmr-reader/dsmr_consumption/forms.py", line 27, in clean
    end__gte=current_end

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/query.py", line 942, in filter
    return self._filter_or_exclude(False, *args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/query.py", line 962, in _filter_or_exclude
    clone._filter_or_exclude_inplace(negate, *args, **kwargs)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/query.py", line 969, in _filter_or_exclude_inplace
    self._query.add_q(Q(*args, **kwargs))

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1358, in add_q
    clause, _ = self._add_q(q_object, self.used_aliases)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1380, in _add_q
    split_subq=split_subq, check_filterable=check_filterable,

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1244, in build_filter
    check_filterable=check_filterable,

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1380, in _add_q
    split_subq=split_subq, check_filterable=check_filterable,

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1244, in build_filter
    check_filterable=check_filterable,

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1380, in _add_q
    split_subq=split_subq, check_filterable=check_filterable,

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1319, in build_filter
    condition = self.build_lookup(lookups, col, value)

  File "/home/dsmr/.virtualenvs/dsmrreader/lib/python3.7/site-packages/django/db/models/sql/query.py", line 1170, in build_lookup
    raise ValueError("Cannot use None as a query value")
@dennissiemensma
Copy link
Member

Bedankt voor je melding.

  • Op welke versie zat je eerst?
  • Welke gegevens vul je in?

Ik kan het zelf namelijk niet reproduceren met zowel een aanpassing als een nieuw contract:

Screenshot_2020-08-31 Change Energy supplier price DSMR-reader

@gnissahr
Copy link
Author

Ik ben begonnen op 3.11. ik heb toen 1 enkel contract ingevuld. Ik heb nu nog steeds 1 contract. Maar bij alles wat ik doe krijg ik "Cannot use None as a query value".

De reden dat ik er nu tegenaan loop is dat ik het dagtarief in wil vullen.
Naar aanleiding van je screenshot heb ik ook een einddatum voor het contract ingevuld (heb ik niet, maar goed).

Dan doet ie het wel.... Dus de "none" slaat blijkbaar op het ontbreken van een einddatum.

Mooi stukje software trouwens!

@dennissiemensma
Copy link
Member

Dank voor de debuggen! Ik zal het dan meenemen in een volgende release.

Voor nu kun je dan het contract 10 jaar (of verder) in de toekomst zetten als workaround.

@dennissiemensma dennissiemensma added this to the 4.4 milestone Aug 31, 2020
@dennissiemensma dennissiemensma changed the title Kan energiecontract niet aanpassen Fout bij toevoegen/wijzigen energiecontract zonder einddatum Aug 31, 2020
@dennissiemensma
Copy link
Member

Opgelost in de volgende release. Nogmaals dank voor het uitzoeken.

@dennissiemensma
Copy link
Member

Zojuist uitgebracht in v4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants