Skip to content

Commit

Permalink
Merge new User database model (#18)
Browse files Browse the repository at this point in the history
* update excel templates

* export for participation certificates (#16)

* add check boxes to courses.html, implement participation certificate generator

* return applicant mail if checkbox in course.html is marked

* write logic for participation_cert pdf generation and implement zip-writer

* nicer checkbox design

* minor final changes

* minor changes in spanish templates

* bugfix on spanisch_hueber

* give all users the possibility to generate participation certificates

* Fix non-discounted price being shown in outstanding payments

* Use roles to store user permissions

* Add helper to check if user has superuser role

* Rename LANGUAGE_ADMIN role to COURSE_ADMIN

* Update can_edit_course check with new role system

* Create log entries for courses, not for languages

* Replace usages of user.languages

* Add additional teacher attributes to user model

---------

Co-authored-by: Tobias Dierich <[email protected]>
  • Loading branch information
urvdp and tobiasdierich committed Apr 12, 2024
1 parent 3c14825 commit 9d78222
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/spz/forms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,13 +1028,15 @@ def get_send_mail(self):




class CourseForm(FlaskForm):
""" A form to select different participants in that specific course
"""
identifier = StringField()




class GradeSubform(Form):
grade = IntegerField("Note")
identifier = HiddenField("student_id")
Expand All @@ -1046,3 +1048,4 @@ def set_id(self, custom_id):
class GradeForm(FlaskForm):
grades = FieldList(FormField(GradeSubform))


4 changes: 2 additions & 2 deletions src/spz/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,8 +821,7 @@ def course(id):

return html_response(zip_file, "Teilnahmescheine_{}".format(course.full_name))


if form.identifier.data == 'form-delete' and form_delete.validate_on_submit() and current_user.superuser:
if form.identifier.data == 'form-delete' and form_delete.validate_on_submit() and current_user.is_superuser:
try:
deleted = 0
name = course.full_name
Expand Down Expand Up @@ -1233,6 +1232,7 @@ def login():

return dict(form=form)


def logout():
logout_user()
flash(_('Tschau!'), 'success')
Expand Down

0 comments on commit 9d78222

Please sign in to comment.