Commit 0a6f481a authored by Stefano Alberto Russo's avatar Stefano Alberto Russo
Browse files

Bugfix of some strange behaviour of an https:// contained as part in the URL...

Bugfix of some strange behaviour of an https:// contained as part in the URL transformed into https:/.
parent 3017d952
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -1219,6 +1219,14 @@ def new_binder_task(request, repository):
    repository_tag = repository.split('/')[-1]
    repository_url = repository.replace('/'+repository_tag, '')

    # I have no idea why the https:// of the repo part of the url gets transfrmed in https:/
    # Here i work around this, but TODO: understand what the hell is going on.
    if 'https:/' in repository_url and not 'https://' in repository_url:
        repository_url = repository_url.replace('https:/', 'https://')
    
    if not repository_tag:
        repository_tag='HEAD'

    data['repository_url'] = repository_url
    data['repository_tag'] = repository_tag
    
@@ -1240,10 +1248,18 @@ def import_repository(request):
    data={}
    data['user']  = request.user
    
    data['repository_url'] = request.GET.get('repository_url', None)
    data['repository_tag'] = request.GET.get('repository_tag', 'HEAD')
    if not data['repository_tag']:
        data['repository_tag']='HEAD'
    repository_url = request.GET.get('repository_url', None)
    # I have no idea why the https:// of the repo part of the url gets transfrmed in https:/
    # Here i work around this, but TODO: understand what the hell is going on.
    if 'https:/' in repository_url and not 'https://' in repository_url:
        repository_url = repository_url.replace('https:/', 'https://')
    
    repository_tag= request.GET.get('repository_tag', None)
    if not repository_tag:
        repository_tag='HEAD'
        
    data['repository_url'] = repository_url
    data['repository_tag'] = repository_tag

    data['container_name'] = request.GET.get('container_name', None)
    data['container_description'] = request.GET.get('container_description', None)