Skip to content

Commit

Permalink
fix: update to show only bcs and run migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
idabblewith committed Sep 6, 2024
1 parent 6a8d9be commit 404a88d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ ENV PATH="${PATH}:/usr/lib/prince/bin"

# Delete non-commercial license of Prince
RUN rm -f /usr/lib/prince/license/license.dat
# Create a symlink to the commercial license file
# Assumes that a valid Prince commercial license file is available in the backend/files directory
# Current license is set to expire on 31.05.2025
RUN ln -s /usr/src/app/backend/files/license.dat /usr/lib/prince/license/license.dat

# ====================== DEV FILES AND DEPENDENCIES ======================
Expand Down
7 changes: 6 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@

# Output the license template to license.dat
# echo "$LICENSE_TEMPLATE" > /usr/lib/prince/license/license.dat
echo "Creating license.dat symlink..."
ln -s /usr/src/app/backend/files/license.dat /usr/lib/prince/license/license.dat


# Run Django migrations
echo "Running Django migrations..."
python manage.py makemigrations
python manage.py migrate

# Launch backend (moved from Dockerfile to run after securely setting Prince license)
echo "Launching gunicorn..."
Expand Down
5 changes: 4 additions & 1 deletion users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,10 @@ def get(self, req):
user.unit = user_data.get("unit")
user.location = user_data.get("location")
user.position = user_data.get("title")
updated_users.append(user)

# Filter users based on BCS division
if user.division == "Biodiversity and Conservation Science":
updated_users.append(user)

total_users = len(updated_users)
total_pages = ceil(total_users / page_size)
Expand Down

0 comments on commit 404a88d

Please sign in to comment.