Skip to content
Snippets Groups Projects
Commit 4dc4cb66 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

increase configuration field length to 3000 to hold dcache token

parent b83848ad
Branches
No related tags found
2 merge requests!234Master,!233increase configuration field length to 3000 to hold dcache token
# Generated by Django 3.1.4 on 2022-04-12 11:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('taskdatabase', '0015_auto_20220401_1336'),
]
operations = [
migrations.AlterField(
model_name='configuration',
name='value',
field=models.CharField(max_length=3000),
),
]
......@@ -184,7 +184,8 @@ class Status(models.Model):
class Configuration(models.Model):
filter = models.CharField(max_length=30, blank=True, null=True)
key = models.CharField(max_length=50)
value = models.CharField(max_length=255)
# large value needed to hold the dcache token
value = models.CharField(max_length=3000)
# the representation of the value in the REST API
def __str__(self):
......
......@@ -673,15 +673,16 @@ def construct_inspectionplots(task):
except:
srm_to_url = "srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data::https://webdav.grid.surfsara.nl/pnfs/grid.sara.nl/data"
token = Configuration.objects.get(key='dcache:token').value
#token ="dcache-http-uuid=23f731bb-0ec4-4401-9176-3393cf2a3da1"
token = str(Configuration.objects.get(key='dcache:token').value)
#token ="23f731bb-0ec4-4401-9176-3393cf2a3da1"
#token = "MDAxY2xvY2F0aW9uIE9wdGlvbmFsLmVtcHR5CjAwMThpZGVudGlmaWVyIDhSWm1md3ovCjAwMTVjaWQgaWlkOnJEWm1JL2VGCjAwMmFjaWQgaWQ6NTU1ODI7MzE4NTUsMzQ5ODMsNDM0ODU7bGR2b3BzCjAwMmJjaWQgYmVmb3JlOjIwMjItMDQtMThUMTM6MDc6MzkuNzg2NTU3WgowMDM4Y2lkIHJvb3Q6L3BuZnMvZ3JpZC5zYXJhLm5sL2RhdGEvbG9mYXIvb3BzL2Rpc2svbGR2CjAwMWZjaWQgYWN0aXZpdHk6RE9XTkxPQUQsTElTVAowMDE1Y2lkIGlwOjAuMC4wLjAvMAowMDJmc2lnbmF0dXJlIMlsLlm43VRA-uDXqAWTlS2A9HeYnSiUA2jFvKi7DwchCg"
translation = srm_to_url.split("::")
# find the plots in the quality json structure
plots = task.quality_json["plots"]
for plot in plots:
basename = plot['basename']
surl = plot['surl'] + "?" + token
surl = plot['surl'] + "?action=show&authz=" + str(token)
url = surl.replace(translation[0],translation[1])
results += '<tr><td><a href="' + url + '" target="_blank">'+ basename + '</a></td></tr>'
......
......@@ -34,7 +34,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p class="footer"> Version 1.0.0 (12 apr 2021 - 8:00)
<p class="footer"> Version 1.0.0 (12 apr 2021 - 13:00)
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment