Changeset 16412


Ignore:
Timestamp:
10 Mar 2021, 12:25:31 (4 years ago)
Author:
Henrik Bettermann
Message:

Allow lecturers to export all course tickets, not only those of current academic session.

Location:
main/waeup.kofa/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r16387 r16412  
    441.6.1.dev0 (unreleased)
    55=======================
     6
     7* Allow lecturers to export all course tickets, not only
     8  those of current academic session.
    69
    710* Disable clearance request button if not in state 'clearance started'.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r16387 r16412  
    44294429        return
    44304430
     4431    # Disabled on 10/03/21
     4432    #def _set_session_values(self):
     4433    #    # We allow only current academic session
     4434    #    academic_session = grok.getSite()['configuration'].current_academic_session
     4435    #    if not academic_session:
     4436    #        self.sessions = []
     4437    #        return
     4438    #    x = academic_sessions_vocab.getTerm(academic_session)
     4439    #    self.sessions = [(x.title, x.token)]
     4440    #    return
     4441
    44314442    def _set_session_values(self):
    4432         # We allow only current academic session
    4433         academic_session = grok.getSite()['configuration'].current_academic_session
    4434         if not academic_session:
    4435             self.sessions = []
    4436             return
    4437         x = academic_sessions_vocab.getTerm(academic_session)
    4438         self.sessions = [(x.title, x.token)]
     4443        vocab_terms = academic_sessions_vocab.by_value.values()
     4444        self.sessions = sorted(
     4445            [(x.title, x.token) for x in vocab_terms], reverse=True)
     4446        self.sessions += [('All Sessions', 'all')]
    44394447        return
    44404448
     
    44494457        self._set_mode_values()
    44504458        self._set_exporter_values()
    4451         if not self.sessions:
    4452             self.flash(
    4453                 _('Academic session not set. '
    4454                   'Please contact the administrator.'),
    4455                 type='danger')
    4456             self.redirect(self.url(self.context))
    4457             return
     4459        # Disabled on 10/03/21
     4460        #if not self.sessions:
     4461        #    self.flash(
     4462        #        _('Academic session not set. '
     4463        #          'Please contact the administrator.'),
     4464        #        type='danger')
     4465        #    self.redirect(self.url(self.context))
     4466        #    return
    44584467        if START is None:
    44594468            return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r16351 r16412  
    114114    """Get course tickets of `students`.
    115115    Filter course tickets which belong to this course code and
    116     which are editable by lecturers.
     116    which are editable by lecturers. The latter requirement was disabled
     117    on 10/03/21.
    117118    """
    118119    tickets = []
     
    124125            if ticket.code != code:
    125126                continue
    126             if not ticket.editable_by_lecturer:
    127                 continue
     127            # Disabled on 10/03/21
     128            #if not ticket.editable_by_lecturer:
     129            #    continue
    128130            if level not in ('all', None):
    129131                if level_obj.level in (10, 999, None)  \
     
    545547    tickets catalog and exports those course tickets which belong to the
    546548    given course code, meet level and session passed through at the
    547     same time, and which are editable by lecturers. This exporter can only
    548     be called at course level in the academic section.
     549    same time, and which are editable by lecturers (disabled on 10/03/21).
     550    This exporter can only be called at course level in the academic section.
    549551    """
    550552    grok.name('lecturer')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/student.py

    r16248 r16412  
    235235    @property
    236236    def current_verdict(self):
    237         level = getattr(
     237        current_verdict = getattr(
    238238            self.get('studycourse', None), 'current_verdict', None)
    239         return level
     239        return current_verdict
    240240
    241241    @property
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r16333 r16412  
    45204520        self.browser.open(course1_path)
    45214521        self.browser.getLink("Export student data").click()
    4522         self.browser.getControl("Set export parameters").click()
    4523         self.assertTrue(
    4524             'Academic session not set. Please contact the administrator.'
    4525             in self.browser.contents)
    4526         self.app['configuration'].current_academic_session = 2004
     4522        # Disabled on 10/03/21
     4523        #self.browser.getControl("Set export parameters").click()
     4524        #self.assertTrue(
     4525        #    'Academic session not set. Please contact the administrator.'
     4526        #    in self.browser.contents)
     4527        #self.app['configuration'].current_academic_session = 2004
    45274528        self.browser.getControl("Set export parameters").click()
    45284529        self.browser.getControl(name="exporter").value = ['lecturer']
Note: See TracChangeset for help on using the changeset viewer.