Просмотр исходного кода

further resolution of URL redirects issue

joel
Simon Bowie 2 лет назад
Родитель
Сommit
8063a84dab
5 измененных файлов: 12 добавлений и 12 удалений
  1. +2
    -2
      web/app/book.py
  2. +4
    -4
      web/app/create.py
  3. +2
    -2
      web/app/practice.py
  4. +2
    -2
      web/app/publisher.py
  5. +2
    -2
      web/app/tool.py

+ 2
- 2
web/app/book.py Просмотреть файл

@@ -45,7 +45,7 @@ def edit_book(book_id):
book.name = name
book.description = description
db.session.commit()
return redirect(url_for('book.get_books'))
return redirect(url_for('book.get_books',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

return render_template('edit.html', resource=book)

@@ -54,4 +54,4 @@ def edit_book(book_id):
@login_required
def delete_book(book_id):
delete_resource(book_id)
return redirect(url_for('book.get_books'))
return redirect(url_for('book.get_books',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

+ 4
- 4
web/app/create.py Просмотреть файл

@@ -41,7 +41,7 @@ def create_resource():

if tool: # if a tool is found, we want to redirect back to create page
flash('Tool with same name already exists')
return redirect(url_for('create.create_resource'))
return redirect(url_for('create.create_resource',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

# create a new tool with the form data
new_tool = Resource(type=type, name=name, description=description, projectUrl=projectUrl, repositoryUrl=repositoryUrl, expertiseToUse=expertiseToUse, expertiseToHost=expertiseToHost, dependencies=dependencies, ingestFormats=ingestFormats, outputFormats=outputFormats, status=status)
@@ -67,7 +67,7 @@ def create_resource():

if practice: # if a practice is found, we want to redirect back to create page
flash('Practice with same name already exists')
return redirect(url_for('create.create_resource'))
return redirect(url_for('create.create_resource',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

# create a new practice with the form data
new_practice = Resource(type=type, name=name, description=description)
@@ -89,7 +89,7 @@ def create_resource():

if publisher: # if a publisher is found, we want to redirect back to create page
flash('Publisher with same name already exists')
return redirect(url_for('create.create_resource'))
return redirect(url_for('create.create_resource',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

# create a new publisher with the form data
new_publisher = Resource(type=type, name=name, description=description, publisherUrl=publisherUrl)
@@ -110,7 +110,7 @@ def create_resource():

if book: # if a book is found, we want to redirect back to create page
flash('Book with same name already exists')
return redirect(url_for('create.create_resource'))
return redirect(url_for('create.create_resource',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

# create a new book with the form data
new_book = Resource(type=type, name=name, description=description)

+ 2
- 2
web/app/practice.py Просмотреть файл

@@ -59,7 +59,7 @@ def edit_practice(practice_id):
if remove_linked_resources:
for remove_linked_resource in remove_linked_resources:
delete_relationship(practice_id, remove_linked_resource)
return redirect(url_for('practice.get_practices'))
return redirect(url_for('practice.get_practices',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

return render_template('edit.html', resource=practice, resource_dropdown=resource_dropdown, links=links)

@@ -68,4 +68,4 @@ def edit_practice(practice_id):
@login_required
def delete_practice(practice_id):
delete_resource(practice_id)
return redirect(url_for('practice.get_practices'))
return redirect(url_for('practice.get_practices',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

+ 2
- 2
web/app/publisher.py Просмотреть файл

@@ -45,7 +45,7 @@ def edit_publisher(publisher_id):
publisher.name = name
publisher.description = description
db.session.commit()
return redirect(url_for('publisher.get_publishers'))
return redirect(url_for('publisher.get_publishers',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

return render_template('edit.html', resource=publisher)

@@ -54,4 +54,4 @@ def edit_publisher(publisher_id):
@login_required
def delete_publisher(publisher_id):
delete_resource(publisher_id)
return redirect(url_for('publisher.get_publishers'))
return redirect(url_for('publisher.get_publishers',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

+ 2
- 2
web/app/tool.py Просмотреть файл

@@ -75,7 +75,7 @@ def edit_tool(tool_id):
if remove_linked_resources:
for remove_linked_resource in remove_linked_resources:
delete_relationship(tool_id, remove_linked_resource)
return redirect(url_for('tool.get_tools'))
return redirect(url_for('tool.get_tools',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

return render_template('edit.html', resource=tool, resource_dropdown=resource_dropdown, links=links)

@@ -84,4 +84,4 @@ def edit_tool(tool_id):
@login_required
def delete_tool(tool_id):
delete_resource(tool_id)
return redirect(url_for('tool.get_tools'))
return redirect(url_for('tool.get_tools',_external=True,_scheme=os.environ.get('SSL_SCHEME')))

Загрузка…
Отмена
Сохранить