Duplicated profiles in speakers list #70757

Closed
opened 2019-10-12 12:12:25 +02:00 by Francesco Siddi · 6 comments

If a speaker is part of 2 or more accepted presentations, their profile will appear an equal amount of times in the speakers page.

Ideally we want to show the speaker profile only once :)

If a speaker is part of 2 or more accepted presentations, their profile will appear an equal amount of times in the [speakers page](https://conference.blender.org/2019/speakers). Ideally we want to show the speaker profile only once :)
Sem Mulder was assigned by Francesco Siddi 2019-10-12 12:12:25 +02:00
Author
Owner

Added subscriber: @fsiddi

Added subscriber: @fsiddi

Which speaker specifically shows up twice? I think this might be because there are two Profiles with the same name.

Which speaker specifically shows up twice? I think this might be because there are two Profiles with the same name.
Ah, it's Django's ORM: https://stackoverflow.com/questions/38452359/why-filter-in-django-returns-duplicated-objects. This is why I do not like ORMs...
Author
Owner

Currently crashes in production with the following.

  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/defaulttags.py", line 166, in render
    len_values = len(values)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 256, in __len__
    self._fetch_all()
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1100, in execute_sql
    cursor.execute(sql, params)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: SELECT DISTINCT ON expressions must match initial ORDER BY expressions
LINE 1: SELECT DISTINCT ON ("conference_main_profile"."id") "confere..

Will revert the commit for now. Please consider adding a test for this once it's fixed :)

Currently crashes in production with the following. ``` File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render return self.nodelist.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render bit = node.render_annotated(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated return self.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 150, in render return compiled_parent._render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 163, in _render return self.nodelist.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render bit = node.render_annotated(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated return self.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render bit = node.render_annotated(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated return self.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/loader_tags.py", line 62, in render result = block.nodelist.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 937, in render bit = node.render_annotated(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/base.py", line 904, in render_annotated return self.render(context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/template/defaulttags.py", line 166, in render len_values = len(values) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 256, in __len__ self._fetch_all() File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__ results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1100, in execute_sql cursor.execute(sql, params) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers return executor(sql, params, many, context) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/var/www/blender-conference/.venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: SELECT DISTINCT ON expressions must match initial ORDER BY expressions LINE 1: SELECT DISTINCT ON ("conference_main_profile"."id") "confere.. ``` Will revert the commit for now. Please consider adding a test for this once it's fixed :)

Whoops. Should be fixed with the latest commit.

Whoops. Should be fixed with the latest commit.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No Assignees
2 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: infrastructure/conference-website#70757
No description provided.