Skip to content

Commit

Permalink
update req
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhamedAyoub committed Jun 6, 2024
1 parent 4cb238f commit 30d48b2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ FROM python:3.11

WORKDIR /app

COPY requirements.production.txt .
COPY requirements.txt .

RUN pip install -r requirements.production.txt
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

Expand Down
7 changes: 4 additions & 3 deletions authentication/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def create_permit_user(user:dict):
elif user["role"] == "student":
try:
print("Grouping ")
group_promo = f"{user['group']}-{user['promo']}"
group_promo = user['group'] + "-" + user['promo']
promo = user['promo']
permit.api.resource_instances.create(instance_data={
"key": group_promo,
"tenant": settings.PERMIT_TENANT,
Expand All @@ -57,13 +58,13 @@ def create_permit_user(user:dict):
try:
print(f"create promo {user['promo']}")
permit.api.resource_instances.create(instance_data={
"key": user["promo"],
"key": promo,
"tenant": settings.PERMIT_TENANT,
"resource": "promo",
})
permit.api.users.assign_role({
"user": user_data["key"],
"role": f"promo:{user["promo"]}#Members",
"role": f"promo:{promo}#Members",
"tenant": settings.PERMIT_TENANT
})
except Exception as e:
Expand Down
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

sleep 3
python manage.py makemigrations
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
python manage.py makemigrations --settings=core.settings.production
python manage.py migrate --settings=core.settings.production
python manage.py runserver 0.0.0.0:8000 --settings=core.settings.production
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ Django==5.0.3
django-cors-headers==4.3.1
djangorestframework==3.14.0
djangorestframework-simplejwt==5.3.1
psycopg2-binary==2.9.9
PyJWT==2.8.0
python-dotenv
python-dotenv==1.0.1
pytz==2024.1
sqlparse==0.4.4
typing_extensions==4.10.0
drf_spectacular
faker
permit
kafka-python
confluent_kafka
permit==2.5.0
confluent-kafka==2.4.0

0 comments on commit 30d48b2

Please sign in to comment.