Skip to content

Commit

Permalink
add USE_GENE_UNAME env var
Browse files Browse the repository at this point in the history
  • Loading branch information
abretaud committed Apr 6, 2018
1 parent 68692a3 commit bcecb7b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ ENV SITE_NAME="lis" \
GCV_URL="http://localhost:8100" \
TRIPAL_URL="https://legumeinfo.org" \
DEBUG="false" \
HOST="gcv"
HOST="gcv" \
USE_GENE_UNAME="false"

# Patch needed for external links to tripal_phylotree
ADD PR131.diff /opt/
ADD gene_uname.diff /opt/

RUN mkdir -p /opt/gcv && \
mkdir -p /etc/gcv && \
Expand All @@ -46,7 +48,8 @@ RUN mkdir -p /opt/gcv && \
git checkout b195bf434fb9bc7f280c62c1dbd82642eca63448 && \
patch -p1 < /opt/PR131.diff && \
cd server && \
pip install -r requirements.txt
pip install -r requirements.txt && \
cp services/views.py /etc/gcv/original_views.py

ADD config.json.template /etc/gcv/config.json.template
ADD settings.py /opt/gcv/server/server/settings.py
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The following environment variables are available:
|TRIPAL_URL|Address of a Tripal instance installed with tripal_phylotree module and a tripal_linkout module|https://legumeinfo.org|
|DEBUG|Set to 'true' to activate the debug mode|false|
|HOST|Hostname|gcv|
|USE_GENE_UNAME|Set to 'true' if you prefer GCV to look for genes using their uniquename|false|

## Contributing

Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ npm run build

cd /opt/gcv/server/

cp /etc/gcv/original_views.py services/views.py
if [ "$USE_GENE_UNAME" == "true" ]
then
patch -p1 < /opt/gene_uname.diff
fi

# Run nginx in background
nginx -g "daemon on;"

Expand Down
13 changes: 13 additions & 0 deletions gene_uname.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/services/views.py b/services/views.py
index 895f92b..4d7bc7f 100644
--- a/services/views.py
+++ b/services/views.py
@@ -302,7 +302,7 @@ def v1_gene_to_query_track(request):
# make sure the request type is POST and that it contains a focus gene name
if request.method == 'POST' and 'gene' in POST and 'neighbors' in POST:
# get the focus gene of the query track
- focus = get_object_or_404(Feature, name=POST['gene'])
+ focus = get_object_or_404(Feature, uniquename=POST['gene'])
focus_id = focus.pk
focus_order = list(GeneOrder.objects.filter(gene=focus))
if len(focus_order) == 0:

0 comments on commit bcecb7b

Please sign in to comment.