TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!

Home Page:https://docs.tandoor.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'>=' not supported between instances of 'tuple' and 'int'

danielboros opened this issue · comments

Tandoor Version

1.5.15

Setup

Docker / Docker-Compose

Reverse Proxy

No reverse proxy

Other

No response

Bug description

Think it's due to this change:

3489216

divmod returns tuple.

Relevant logs

Environment:


Request Method: GET
Request URL: https://tandoor.home-lab.kud0h.com/system/

Django Version: 4.2.11
Python Version: 3.12.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.sites',
 'django.contrib.staticfiles',
 'django.contrib.postgres',
 'oauth2_provider',
 'django_prometheus',
 'django_tables2',
 'corsheaders',
 'crispy_forms',
 'crispy_bootstrap4',
 'rest_framework',
 'rest_framework.authtoken',
 'django_cleanup.apps.CleanupConfig',
 'webpack_loader',
 'django_js_reverse',
 'hcaptcha',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'cookbook.apps.CookbookConfig',
 'treebeard',
 'debug_toolbar']
Installed Middleware:
['corsheaders.middleware.CorsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'whitenoise.middleware.WhiteNoiseMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'cookbook.helper.scope_middleware.ScopeMiddleware',
 'allauth.account.middleware.AccountMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware']



Traceback (most recent call last):
  File "/opt/recipes/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/recipes/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/recipes/cookbook/views/views.py", line 300, in system
    if postgres_ver >= postgres_current:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Exception Type: TypeError at /system/
Exception Value: '>=' not supported between instances of 'tuple' and 'int'

@richid do you want to look into this ? maybe wrap all the code in a try catch so that if it breaks again the system page stays alive and default the PG check to something like unknown

amazing how such a small feature already takes I think the fourth PR to be implemented correctly 😞

Hi can work on this bug?

oof, yes this is an embarrassing bug I introduced. 🤦

Apologies everyone, will have a fix out in a minute.

Any chance we could get a new point release soon? I'm hitting this issue on a new install, which means I can't send new user invite links

Any chance we could get a new point release soon? I'm hitting this issue on a new install, which means I can't send new user invite links

That bug doesn't impact ability to send invites.

Fair, I was looking at the wrong location.

Works in 1.5.16. Thanks!