book.name = name | book.name = name | ||||
book.description = description | book.description = description | ||||
db.session.commit() | 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) | return render_template('edit.html', resource=book) | ||||
@login_required | @login_required | ||||
def delete_book(book_id): | def delete_book(book_id): | ||||
delete_resource(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'))) |
if tool: # if a tool is found, we want to redirect back to create page | if tool: # if a tool is found, we want to redirect back to create page | ||||
flash('Tool with same name already exists') | 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 | # 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) | 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) | ||||
if practice: # if a practice is found, we want to redirect back to create page | if practice: # if a practice is found, we want to redirect back to create page | ||||
flash('Practice with same name already exists') | 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 | # create a new practice with the form data | ||||
new_practice = Resource(type=type, name=name, description=description) | new_practice = Resource(type=type, name=name, description=description) | ||||
if publisher: # if a publisher is found, we want to redirect back to create page | if publisher: # if a publisher is found, we want to redirect back to create page | ||||
flash('Publisher with same name already exists') | 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 | # create a new publisher with the form data | ||||
new_publisher = Resource(type=type, name=name, description=description, publisherUrl=publisherUrl) | new_publisher = Resource(type=type, name=name, description=description, publisherUrl=publisherUrl) | ||||
if book: # if a book is found, we want to redirect back to create page | if book: # if a book is found, we want to redirect back to create page | ||||
flash('Book with same name already exists') | 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 | # create a new book with the form data | ||||
new_book = Resource(type=type, name=name, description=description) | new_book = Resource(type=type, name=name, description=description) |
if remove_linked_resources: | if remove_linked_resources: | ||||
for remove_linked_resource in remove_linked_resources: | for remove_linked_resource in remove_linked_resources: | ||||
delete_relationship(practice_id, remove_linked_resource) | 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) | return render_template('edit.html', resource=practice, resource_dropdown=resource_dropdown, links=links) | ||||
@login_required | @login_required | ||||
def delete_practice(practice_id): | def delete_practice(practice_id): | ||||
delete_resource(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'))) |
publisher.name = name | publisher.name = name | ||||
publisher.description = description | publisher.description = description | ||||
db.session.commit() | 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) | return render_template('edit.html', resource=publisher) | ||||
@login_required | @login_required | ||||
def delete_publisher(publisher_id): | def delete_publisher(publisher_id): | ||||
delete_resource(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'))) |
if remove_linked_resources: | if remove_linked_resources: | ||||
for remove_linked_resource in remove_linked_resources: | for remove_linked_resource in remove_linked_resources: | ||||
delete_relationship(tool_id, remove_linked_resource) | 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) | return render_template('edit.html', resource=tool, resource_dropdown=resource_dropdown, links=links) | ||||
@login_required | @login_required | ||||
def delete_tool(tool_id): | def delete_tool(tool_id): | ||||
delete_resource(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'))) |