mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-17 06:19:24 +08:00
Fixed subject names still having \r symbols in them and fixed student status list view not working
This commit is contained in:
parent
e734afd631
commit
cc52931956
3 changed files with 4 additions and 4 deletions
|
@ -17,7 +17,7 @@ class StudentStatusSerializer(serializers.ModelSerializer):
|
|||
|
||||
class Meta:
|
||||
model = StudentStatus
|
||||
fields = '__all__'
|
||||
fields = ['user', 'subject', 'location', 'active', 'landmark']
|
||||
read_only_fields = ['user', 'landmark']
|
||||
|
||||
def create(self, validated_data):
|
||||
|
|
|
@ -22,8 +22,8 @@ class StudentStatusAPIView(generics.RetrieveUpdateAPIView):
|
|||
|
||||
class ActiveStudentStatusListAPIView(generics.ListAPIView):
|
||||
serializer_class = StudentStatusSerializer
|
||||
permission_classes = [IsAuthenticated]
|
||||
# permission_classes = [IsAuthenticated]
|
||||
|
||||
def get_queryset(self):
|
||||
user = self.request.user
|
||||
return StudentStatus.objects.filter(user != user).filter(active=True)
|
||||
return StudentStatus.objects.filter(active=True and user != user)
|
||||
|
|
|
@ -58,7 +58,7 @@ def populate_subjects(sender, **kwargs):
|
|||
subject_year_level = year_term[0].strip()
|
||||
subject_semester = year_term[1].strip()
|
||||
subject_code = row[1]
|
||||
subject_name = row[2].replace("\n", " ")
|
||||
subject_name = row[2].replace("\n", " ").replace("\r", "")
|
||||
|
||||
# Definitions of subjects to ignore
|
||||
ignored_subject_codes = ['NSTP', 'ROTC', 'CWTS', 'LTS']
|
||||
|
|
Loading…
Reference in a new issue