~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/marks.py

  • Committer: William Grant
  • Date: 2010-07-28 05:06:15 UTC
  • Revision ID: grantw@unimelb.edu.au-20100728050615-uwbxn9frla3pdw8m
Encode content_type when downloading files. cjson made us write bad code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
        # User may supply a "cutoff date" to calculate marks as of that date
50
50
        # Default to current time
51
 
        cutoff = datetime.datetime.now()
 
51
        cutoff = offering.worksheet_cutoff or datetime.datetime.now()
52
52
        data = dict(req.get_fieldstorage())
53
53
        if data.get('cutoff') is not None:
54
54
            try:
91
91
 
92
92
        # User may supply a "cutoff date" to calculate marks as of that date
93
93
        # Default to current time
94
 
        cutoff = datetime.datetime.now()
 
94
        cutoff = offering.worksheet_cutoff or datetime.datetime.now()
95
95
        data = dict(req.get_fieldstorage())
96
96
        if data.get('cutoff') is not None:
97
97
            try:
107
107
        req.headers_out.add('Content-Disposition',
108
108
            "attachment; filename=marks-%s-%ss%s.csv" %
109
109
            (offering.subject.short_name, offering.semester.year,
110
 
             offering.semester.semester))
 
110
             offering.semester.url_name))
111
111
 
112
112
        # "worksheets" is a list of (assessable, published) worksheet names
113
113
        worksheets = offering.worksheets.find(assessable=True, published=True)