Skip to content

Commit

Permalink
Úprava logování a historie souboru
Browse files Browse the repository at this point in the history
  • Loading branch information
jhavrlant committed Jan 9, 2025
1 parent 19d45f3 commit db1e744
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions webclient/core/repository_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,15 +1448,15 @@ def call_digiarchiv_update():
i.active(),
)
except Exception as e:
logger.error(
"core_repository_connector.FedoraTransaction.call_digiarchiv_update.Celery_error",
logger.warning(
"core_repository_connector.FedoraTransaction.call_digiarchiv_update.Celery_warning",
extra={"Exception": e, "app": app},
)
call_digiarchiv_update_task.apply_async()
for queue in queues:
if queue is None:
logger.error(
"core_repository_connector.FedoraTransaction.call_digiarchiv_update.error",
logger.warning(
"core_repository_connector.FedoraTransaction.call_digiarchiv_update.warning",
extra={"i": i, "queues": queues},
)
break
Expand Down
3 changes: 2 additions & 1 deletion webclient/historie/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import CharField, F, Value
from django.db.models.functions import Concat
from django.shortcuts import get_object_or_404
from django.utils.translation import get_language
from django.views.generic import ListView
from django_tables2 import SingleTableMixin
Expand Down Expand Up @@ -175,7 +176,7 @@ def get_context_data(self, **kwargs):
soubor_id = self.kwargs["soubor_id"]
context["typ"] = "soubor"
context["entity"] = context["typ"]
soubor = Soubor.objects.get(pk=soubor_id)
soubor = get_object_or_404(Soubor, pk=soubor_id)
try:
context["projekt"] = soubor.vazba.projekt_souboru
except Projekt.DoesNotExist:
Expand Down
8 changes: 4 additions & 4 deletions webclient/xml_generator/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ def check_if_task_queued(class_name, pk, task_name):
i = app.control.inspect(["worker1@amcr"])
queues = (i.scheduled(),)
except Exception as e:
logger.error(
"xml_generator.models.ModelWithMetadata.check_if_task_queued.Celery_error",
logger.warning(
"xml_generator.models.ModelWithMetadata.check_if_task_queued.Celery_warning",
extra={"Exception": e, "app": app},
)
return False
for queue in queues:
if queue is None:
logger.error(
"xml_generator.models.ModelWithMetadata.check_if_task_queued.error",
logger.warning(
"xml_generator.models.ModelWithMetadata.check_if_task_queued.warning",
extra={"class_name": class_name, "pk": pk, "i": i, "queues": queues},
)
return False
Expand Down

0 comments on commit db1e744

Please sign in to comment.