mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-11 00:58:32 -05:00
Merge branch 'develop' into feature/vue3
# Conflicts: # cookbook/urls.py
This commit is contained in:
@@ -6,6 +6,8 @@ from cookbook.models import (Food, FoodProperty, Property, PropertyType, Superma
|
||||
SupermarketCategory, SupermarketCategoryRelation, Unit, UnitConversion)
|
||||
import re
|
||||
|
||||
from recipes.settings import DEBUG
|
||||
|
||||
|
||||
class OpenDataImportResponse:
|
||||
total_created = 0
|
||||
@@ -367,12 +369,28 @@ class OpenDataImporter:
|
||||
create_list.append({'data': obj_dict})
|
||||
|
||||
if self.update_existing and len(update_list) > 0:
|
||||
model_type.objects.bulk_update(update_list, field_list)
|
||||
od_response.total_updated += len(update_list)
|
||||
try:
|
||||
model_type.objects.bulk_update(update_list, field_list)
|
||||
od_response.total_updated += len(update_list)
|
||||
except Exception:
|
||||
if DEBUG:
|
||||
print('========= LOAD FOOD FAILED ============')
|
||||
print(update_list)
|
||||
print(existing_data_names)
|
||||
print(existing_data_slugs)
|
||||
traceback.print_exc()
|
||||
|
||||
if len(create_list) > 0:
|
||||
Food.load_bulk(create_list, None)
|
||||
od_response.total_created += len(create_list)
|
||||
try:
|
||||
Food.load_bulk(create_list, None)
|
||||
od_response.total_created += len(create_list)
|
||||
except Exception:
|
||||
if DEBUG:
|
||||
print('========= LOAD FOOD FAILED ============')
|
||||
print(create_list)
|
||||
print(existing_data_names)
|
||||
print(existing_data_slugs)
|
||||
traceback.print_exc()
|
||||
|
||||
# --------------- PROPERTY STUFF -----------------------
|
||||
model_type = Property
|
||||
|
||||
@@ -13,8 +13,8 @@ msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-05-18 14:28+0200\n"
|
||||
"PO-Revision-Date: 2023-07-06 21:19+0000\n"
|
||||
"Last-Translator: Rubens <rubenixnagios@gmail.com>\n"
|
||||
"PO-Revision-Date: 2024-03-08 23:19+0000\n"
|
||||
"Last-Translator: Enric Bergadà <enric@bergada.cat>\n"
|
||||
"Language-Team: Catalan <http://translate.tandoor.dev/projects/tandoor/"
|
||||
"recipes-backend/ca/>\n"
|
||||
"Language: ca\n"
|
||||
@@ -567,11 +567,11 @@ msgstr "No s'ha pogut analitzar el codi de la plantilla."
|
||||
#: .\cookbook\integration\copymethat.py:44
|
||||
#: .\cookbook\integration\melarecipes.py:37
|
||||
msgid "Favorite"
|
||||
msgstr ""
|
||||
msgstr "Preferit"
|
||||
|
||||
#: .\cookbook\integration\copymethat.py:50
|
||||
msgid "I made this"
|
||||
msgstr ""
|
||||
msgstr "Ho he fet jo"
|
||||
|
||||
#: .\cookbook\integration\integration.py:218
|
||||
msgid ""
|
||||
|
||||
@@ -14,7 +14,7 @@ msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-05-18 14:28+0200\n"
|
||||
"PO-Revision-Date: 2024-03-03 23:19+0000\n"
|
||||
"PO-Revision-Date: 2024-03-05 22:19+0000\n"
|
||||
"Last-Translator: Jocelin Lebreton <jocelin.lebreton@gmail.com>\n"
|
||||
"Language-Team: French <http://translate.tandoor.dev/projects/tandoor/"
|
||||
"recipes-backend/fr/>\n"
|
||||
@@ -2128,7 +2128,7 @@ msgstr "Se connecter via %(provider)s"
|
||||
#, python-format
|
||||
msgid "You are about to sign in using a third party account from %(provider)s."
|
||||
msgstr ""
|
||||
"ous êtes sur le point de vous connecter en utilisant un compte tiers depuis "
|
||||
"Vous êtes sur le point de vous connecter en utilisant un compte tiers depuis "
|
||||
"%(provider)s."
|
||||
|
||||
#: .\cookbook\templates\socialaccount\login.html:20
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.2.10 on 2024-03-09 06:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cookbook', '0216_delete_shoppinglist'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='userpreference',
|
||||
name='default_page',
|
||||
field=models.CharField(choices=[('SEARCH', 'Search'), ('PLAN', 'Meal-Plan'), ('BOOKS', 'Books'), ('SHOPPING', 'Shopping')], default='SEARCH', max_length=64),
|
||||
),
|
||||
]
|
||||
@@ -449,11 +449,13 @@ class UserPreference(models.Model, PermissionModelMixin):
|
||||
SEARCH = 'SEARCH'
|
||||
PLAN = 'PLAN'
|
||||
BOOKS = 'BOOKS'
|
||||
SHOPPING = 'SHOPPING'
|
||||
|
||||
PAGES = (
|
||||
(SEARCH, _('Search')),
|
||||
(PLAN, _('Meal-Plan')),
|
||||
(BOOKS, _('Books')),
|
||||
(SHOPPING, _('Shopping')),
|
||||
)
|
||||
|
||||
user = AutoOneToOneField(User, on_delete=models.CASCADE, primary_key=True)
|
||||
|
||||
@@ -16,7 +16,7 @@ from .models import (Automation, Comment, CustomFilter, Food, InviteLink, Keywor
|
||||
|
||||
from .views import api, data, delete, edit, import_export, lists, new, telegram, views
|
||||
from .views.api import CustomAuthToken, ImportOpenData
|
||||
|
||||
import datetime
|
||||
|
||||
# extend DRF default router class to allow including additional routers
|
||||
class DefaultRouter(routers.DefaultRouter):
|
||||
@@ -122,9 +122,9 @@ urlpatterns = [
|
||||
path('api/get_recipe_file/<int:recipe_id>/', api.get_recipe_file, name='api_get_recipe_file'),
|
||||
path('api/sync_all/', api.sync_all, name='api_sync'),
|
||||
path('api/log_cooking/<int:recipe_id>/', api.log_cooking, name='api_log_cooking'),
|
||||
path('api/plan-ical/', api.get_plan_ical, name='api_get_plan_ical_future'),
|
||||
path('api/plan-ical/<slug:from_date>/', api.get_plan_ical, name='api_get_plan_ical_from'),
|
||||
path('api/plan-ical/<slug:from_date>/<slug:to_date>/', api.get_plan_ical, name='api_get_plan_ical'),
|
||||
|
||||
path('api/plan-ical/', api.get_plan_ical, kwargs={'from_date': datetime.date.today(), 'to_date': None}, name='api_get_plan_ical_future'),
|
||||
|
||||
path('api/recipe-from-source/', api.RecipeUrlImportView.as_view(), name='api_recipe_from_source'),
|
||||
path('api/backup/', api.get_backup, name='api_backup'),
|
||||
path('api/ingredient-from-string/', api.ingredient_from_string, name='api_ingredient_from_string'),
|
||||
|
||||
@@ -38,7 +38,7 @@ def index(request):
|
||||
return HttpResponseRedirect(reverse_lazy('view_search'))
|
||||
|
||||
try:
|
||||
page_map = {UserPreference.SEARCH: reverse_lazy('view_search'), UserPreference.PLAN: reverse_lazy('view_plan'), UserPreference.BOOKS: reverse_lazy('view_books'), }
|
||||
page_map = {UserPreference.SEARCH: reverse_lazy('view_search'), UserPreference.PLAN: reverse_lazy('view_plan'), UserPreference.BOOKS: reverse_lazy('view_books'), UserPreference.SHOPPING: reverse_lazy('view_shopping'),}
|
||||
|
||||
return HttpResponseRedirect(page_map.get(request.user.userpreference.default_page))
|
||||
except UserPreference.DoesNotExist:
|
||||
@@ -293,11 +293,10 @@ def system(request):
|
||||
|
||||
if postgres:
|
||||
postgres_current = 16 # will need to be updated as PostgreSQL releases new major versions
|
||||
from decimal import Decimal
|
||||
|
||||
from django.db import connection
|
||||
|
||||
postgres_ver = Decimal(str(connection.pg_version).replace('00', '.'))
|
||||
postgres_ver = divmod(connection.pg_version, 10000)
|
||||
if postgres_ver >= postgres_current:
|
||||
database_status = 'success'
|
||||
database_message = _('Everything is fine!')
|
||||
@@ -446,7 +445,7 @@ def web_manifest(request):
|
||||
theme_values['app_name'], "description":
|
||||
_("Manage recipes, shopping list, meal plans and more."), "icons":
|
||||
icons, "start_url":
|
||||
"./search", "background_color":
|
||||
"./", "background_color":
|
||||
theme_values['nav_bg_color'], "display":
|
||||
"standalone", "scope":
|
||||
".", "theme_color":
|
||||
@@ -454,7 +453,7 @@ def web_manifest(request):
|
||||
[{"name": _("Plan"), "short_name": _("Plan"), "description": _("View your meal Plan"), "url":
|
||||
"./plan"}, {"name": _("Books"), "short_name": _("Books"), "description": _("View your cookbooks"), "url": "./books"},
|
||||
{"name": _("Shopping"), "short_name": _("Shopping"), "description": _("View your shopping lists"), "url":
|
||||
"./list/shopping-list/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}}
|
||||
"./shopping/"}], "share_target": {"action": "/data/import/url", "method": "GET", "params": {"title": "title", "url": "url", "text": "text"}}
|
||||
}
|
||||
|
||||
return JsonResponse(manifest_info, json_dumps_params={'indent': 4})
|
||||
|
||||
Reference in New Issue
Block a user