Compare commits

...

27 Commits

Author SHA1 Message Date
Cayo Puigdefabregas 9badf494a6 resolve confict2 2024-10-18 15:30:56 +02:00
Cayo Puigdefabregas d98e8e2d48 resolve conficts 2024-10-18 15:27:39 +02:00
Cayo Puigdefabregas c60a9dd89d commit in login page 2024-10-18 15:25:27 +02:00
pedro 4cf164d4bc add commit footer for docker 2024-10-18 15:25:27 +02:00
pedro 9f05dee6a7 docker-compose: bugfix DOMAIN vs ALLOWED_HOSTS 2024-10-18 15:25:27 +02:00
pedro 1d9d100fae settings: bugfix format assert error msg on DOMAIN 2024-10-18 15:25:27 +02:00
pedro 096b83da81 settings: bugfix assert error msg on DOMAIN 2024-10-18 15:25:27 +02:00
pedro d995db8181 settings: improve assert error msg on DOMAIN 2024-10-18 15:25:27 +02:00
pedro 3d2cb7d184 docker: improve debug 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas b7c4926c39 add commit_id in settings 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas e6141bcc7f more debug in the error answer from api 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas 0b55d34d74 locale in settings 2024-10-18 15:25:27 +02:00
pedro c49644ffbd add ALLOWED_HOSTS in docker compose 2024-10-18 15:25:27 +02:00
pedro 425b032273 docker: use demo true/false instead of y/n 2024-10-18 15:25:27 +02:00
pedro bf47d4bc5d docker: bugfix wrong detection of demo 2024-10-18 15:25:27 +02:00
pedro 67869bc6f5 add predefined_token
as an alternative to the randomly generated, which is also possible
when no predefined_token is defined

also update .env.example vars
2024-10-18 15:25:27 +02:00
pedro f757c58356 snapshot processing: improve warning msg
add comment TODO that system annotation should happen
2024-10-18 15:25:27 +02:00
pedro 0e8607d93e docker: make default user admin 2024-10-18 15:25:27 +02:00
pedro 3d10217599 docker-reset: remove better the db
now that in db dir there are snapshots stored
2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas d8b6d3ded6 fix hid in details of device 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas c422eaddeb clean code comment 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas 090ecc275f fix bug of tag 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas 2f9b61667d remove pdbs 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas 003d224c3e add save snapshots for imports and uploads 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas fae269eb8d save placeholders 2024-10-18 15:25:27 +02:00
Cayo Puigdefabregas 69a54b92fb save snapshots on disk from api 2024-10-18 15:25:27 +02:00
pedro d04216ad79 api snapshot public_url bugfix
with the following code the URL is more appropriate (it basically
mirrors the user's request)

before:

    http://localhost/device/{shortid}

after

    http://localhost:8000/device/{shortid}
2024-10-15 13:16:02 +02:00
1 changed files with 5 additions and 10 deletions

View File

@ -2,15 +2,12 @@ import json
from uuid import uuid4 from uuid import uuid4
from django.conf import settings
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.http import JsonResponse from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect from django.shortcuts import get_object_or_404, redirect
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
from django.core.exceptions import ValidationError
from django_tables2 import SingleTableView from django_tables2 import SingleTableView
from django.views.generic.base import View
from django.views.generic.edit import ( from django.views.generic.edit import (
CreateView, CreateView,
DeleteView, DeleteView,
@ -21,7 +18,6 @@ from utils.save_snapshots import move_json, save_in_disk
from dashboard.mixins import DashboardView from dashboard.mixins import DashboardView
from evidence.models import Annotation from evidence.models import Annotation
from evidence.parse import Build from evidence.parse import Build
from user.models import User
from api.models import Token from api.models import Token
from api.tables import TokensTable from api.tables import TokensTable
@ -79,17 +75,16 @@ def NewSnapshot(request):
if not annotation: if not annotation:
return JsonResponse({'status': 'fail'}, status=200) return JsonResponse({'status': 'fail'}, status=500)
url_args = reverse_lazy("device:details", args=(annotation.value,))
url = request.build_absolute_uri(url_args)
url = "{}://{}{}".format(
request.scheme,
settings.DOMAIN,
reverse_lazy("device:details", args=(annotation.value,))
)
response = { response = {
"status": "success", "status": "success",
"dhid": annotation.value[:6].upper(), "dhid": annotation.value[:6].upper(),
"url": url, "url": url,
# TODO replace with public_url when available
"public_url": url "public_url": url
} }
move_json(path_name, tk.owner.institution.name) move_json(path_name, tk.owner.institution.name)