Skip to content

Commit

Permalink
Fix grycap#78
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Nov 11, 2020
1 parent 11d3233 commit 0e36d9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ def getsites(vo=None):
@authorized_with_valid_token
def getimages(site=None, vo=None):
res = ""
if vo == "local":
local = request.args.get('local', None)
if local:
access_token = oidc_blueprint.session.token['access_token']
for image_name, image_id in utils.get_site_images(site, vo, access_token, cred, session["userid"]):
res += '<option name="selectedSiteImage" value=%s>%s</option>' % (image_id, image_name)
Expand Down
2 changes: 1 addition & 1 deletion app/templates/advanced_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h5>Configure scheduling:</h5>
$('#selectedSiteImage').append("<option value=''>Loading Images ...</option>");
$.ajax({
method: "GET",
url: "{{ url_for('home') }}images/" + $("#selectedSite").val() + "/local",
url: "{{ url_for('home') }}images/" + $("#selectedSite").val() + "/" + $('#selectedVO').val() + "?local=1",
success : function(text)
{
$('#selectedSiteImage').empty();
Expand Down
2 changes: 1 addition & 1 deletion app/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def test_images(self, get_images, get_site_images, avatar):
self.login(avatar)
get_images.return_value = ["IMAGE"]
get_site_images.return_value = [("IMAGE_NAME", "IMAGE_ID")]
res = self.client.get('/images/sitename/local')
res = self.client.get('/images/sitename/vo?local=1')
self.assertEqual(200, res.status_code)
self.assertIn(b'<option name="selectedSiteImage" value=IMAGE_ID>IMAGE_NAME</option>', res.data)
res = self.client.get('/images/sitename/vo')
Expand Down

0 comments on commit 0e36d9f

Please sign in to comment.