Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprint 11 2 #259

Merged
merged 6 commits into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions api/app/resources/bookings/exam/exam_export_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ class ExamList(Resource):
def get(self):

try:

csr = CSR.find_by_username(g.oidc_token_info['username'])

is_designate = csr.finance_designate

start_param = request.args.get("start_date")
end_param = request.args.get("end_date")
exam_type = request.args.get("exam_type")
Expand All @@ -59,15 +62,17 @@ def get(self):

end_date = self.timezone.localize(end_date)

exams = Exam.query.filter_by(office_id=csr.office_id) \
.join(Booking, Exam.booking_id == Booking.booking_id) \
exams = Exam.query.join(Booking, Exam.booking_id == Booking.booking_id) \
.filter(Booking.start_time >= start_date) \
.filter(Booking.start_time < end_date) \
.join(Invigilator, Booking.invigilator_id == Invigilator.invigilator_id, isouter=True) \
.join(Room, Booking.room_id == Room.room_id, isouter=True) \
.join(Office, Booking.office_id == Office.office_id) \
.join(ExamType, Exam.exam_type_id == ExamType.exam_type_id)

if not is_designate:
exams = exams.filter(Booking.office_id == csr.office_id)

if exam_type == 'ita':
exams = exams.filter(ExamType.ita_ind == 1)
elif exam_type == 'all_non_ita':
Expand Down Expand Up @@ -160,10 +165,10 @@ def get(self):


def write_room(row, exam):
if exam.exam_type.group_exam_ind == 1:
row.append("")
else:
if exam.booking and exam.booking.room:
row.append(exam.booking.room.room_name)
else:
row.append("")


def write_invigilator(row, exam):
Expand Down
3 changes: 2 additions & 1 deletion api/app/resources/theq/csrs.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def get(self):
.join(ExamType, Exam.exam_type_id == ExamType.exam_type_id) \
.filter(ExamType.group_exam_ind == 1) \
.join(Booking, Exam.booking_id == Booking.booking_id) \
.filter(Booking.invigilator_id.is_(None)).count()
.filter(Booking.invigilator_id.is_(None))\
.filter(Booking.sbc_staff_invigilated == 0).count()

result = self.csr_schema.dump(csr)
active_citizens = self.citizen_schema.dump(active_citizens)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/booking/scheduling-indicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
return
}
let pushToExams = false
if (this.selectedExam && this.selectedExam.referrer === 'scheduling') {
if (this.selectedExam && this.selectedExam.referrer === 'inventory') {
pushToExams = true
}
this.finishBooking()
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/exams/add-exam-form-confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
<span class="confirm-header">Received Date</span>
</b-col>
<b-col align-self="end" v-if="setup === 'individual'">
<span class="confirm-item">{{ exam.exam_received_date }}</span>
<span class="confirm-item">{{ formatDate(exam.exam_received_date) }}</span>
</b-col>
<b-col align-self="end" v-else>
<span v-if="!tab.showRadio" class="confirm-item">{{ exam.exam_received_date }}</span>
<span v-if="!tab.showRadio" class="confirm-item">{{ formatDate(exam.exam_received_date) }}</span>
<span v-if="tab.showRadio" class="confirm-item">Not Yet Received</span>
</b-col>
</b-row>
Expand Down
Loading