Bug 42492 - ucs-school-exam-and-room-cleanup should use the ucsschool lib
ucs-school-exam-and-room-cleanup should use the ucsschool lib
Status: RESOLVED WONTFIX
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.1 R2
Other Linux
: P5 enhancement (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks: 44157
  Show dependency treegraph
 
Reported: 2016-09-23 16:28 CEST by Florian Best
Modified: 2019-02-05 21:43 CET (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-09-23 16:28:08 CEST
There is code like:
137 »   »   »   univention.admin.modules.update()
138 »   »   »   mod_user = univention.admin.modules.get("users/user")
139 »   »   »   univention.admin.modules.init(lo, position, mod_user)
140 
141 »   »   »   ou_list = self.lo.search(filter='(objectClass=ucsschoolOrganizationalUnit)')
142 »   »   »   for ou_dn, ou_attrs in ou_list:
143 »   »   »   »   ou_name = ou_attrs['ou'][0]
144 »   »   »   »   searchbase = SchoolSearchBase([ou_name], dn=ou_dn)
145 »   »   »   »   userlist = mod_user.lookup({}, lo, 'uid=%s*' % (escape_filter_chars(self.exam_prefix),), base=searchbase.examUsers)
146 »   »   »   »   for user in userlist:
147 »   »   »   »   »   ud.debug(ud.MAIN, ud.PROCESS, 'Removing exam user %r' % (user.dn,))
148 »   »   »   »   »   if self.options.dryrun:
149 »   »   »   »   »   »   ud.debug(ud.MAIN, ud.PROCESS, 'dry-run: skipping removal')
150 »   »   »   »   »   »   continue
151 »   »   »   »   »   user.open()
152 »   »   »   »   »   user.remove()


instead of

from ucsschool.lib.models import ExamStudent
for exam_student in ExamStudent.get_all(lo, school):
   exam_student.remove(lo)

+++ This bug was initially created as a clone of Bug #40213 +++

A customer suggested that it would be great if the exam mode is automatically stopped during the night hours (similar to computer room settings which are also reset during the night).
Comment 1 Florian Best univentionstaff 2017-06-28 14:56:57 CEST
There is a Customer ID set so I set the flag "School Customer affected".
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2019-02-05 21:43:51 CET
This issue has been filled against UCS@school 4.1 (R2). The maintenance with
bug and security fixes for UCS@school 4.1 (R2) has ended on 5th of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3 (or later). 
Please contact your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug"
or simply reopen the issue. In this case please provide detailed information on
how this issue is affecting you.