Skip to content

Commit

Permalink
#123: change mock patient id to two for consistency with frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolkenfarmer committed Apr 9, 2024
1 parent fc3d96f commit 3e35477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/dps_training_k/game/consumers/patient_consumer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from urllib.parse import parse_qs

import game.channel_notifications as channel_notifications
from game.models import Patient, Exercise
from .abstract_consumer import AbstractConsumer
from template.serializer.state_serialize import StateSerializer
import game.channel_notifications as channel_notifications
from .abstract_consumer import AbstractConsumer


class PatientConsumer(AbstractConsumer):
Expand Down Expand Up @@ -51,7 +51,7 @@ def connect(self):
Patient.objects.create(
name="Max Mustermann",
exercise=self.exercise,
patientId=6, # has to be the same as the username in views.py#post
patientId=2, # has to be the same as the username in views.py#post
exercise_id=self.tempExercise.id,
patient_state=self.temp_state,
)
Expand Down
2 changes: 1 addition & 1 deletion backend/dps_training_k/game/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class PatientAccessView(APIView):
def post(self, request, *args, **kwargs):
user, created = User.objects.get_or_create(
username="6" # has to be the same as the username in abstract_consumer.py#authenticate
username="2" # has to be the same as the username in abstract_consumer.py#authenticate
) # Ensure the username is a string
if created:
user.set_password("123456") # Properly hash the password
Expand Down

0 comments on commit 3e35477

Please sign in to comment.