Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2e9dd40
Merge pull request #383 from MAKENTNU/dev
ddabble Oct 21, 2021
bc22647
Merge pull request #385 from MAKENTNU/dev
ddabble Oct 21, 2021
7a5b512
Merge pull request #389 from MAKENTNU/dev
ddabble Oct 29, 2021
599a393
Merge pull request #402 from MAKENTNU/dev
ddabble Jan 10, 2022
fda92e0
Merge pull request #434 from MAKENTNU/dev
sigridge Apr 4, 2022
b886772
Merge pull request #437 from MAKENTNU/dev
ddabble Apr 6, 2022
bdf6efa
Merge pull request #453 from MAKENTNU/dev
ddabble May 20, 2022
fc241cd
Merge pull request #454 from MAKENTNU/dev
ddabble May 20, 2022
009a8e7
Merge pull request #461 from MAKENTNU/dev
ddabble Jun 7, 2022
9016a87
Merge pull request #478 from MAKENTNU/dev
ddabble Jul 17, 2022
6374f2f
Merge pull request #567 from MAKENTNU/dev
ddabble Oct 28, 2022
6b8cdd3
Merge pull request #615 from MAKENTNU/dev
ddabble Mar 30, 2023
a90ac79
Merge pull request #654 from MAKENTNU/dev
Gunvor4 May 10, 2023
a4de522
Merge pull request #730 from MAKENTNU/dev
Gunvor4 May 10, 2024
9e8864f
Added CoursePermission and CourseType
TheStrgamer Sep 19, 2024
fc1cc36
Implemented cource permission class
TheStrgamer Oct 3, 2024
1f90a53
migrated data
TheStrgamer Oct 24, 2024
05b826e
Updated views and admin to use new permission
TheStrgamer Oct 24, 2024
646ab17
fixed bug with auth requirement
TheStrgamer Oct 31, 2024
041a606
added coursepermission to admin
TheStrgamer Dec 28, 2024
9a85902
Updated course page
TheStrgamer Dec 28, 2024
fe2a923
Updated form ui for courses
TheStrgamer Dec 28, 2024
789e91c
Made 3dpr permission automatic
TheStrgamer Jan 14, 2025
c55ba94
updated url tests
TheStrgamer Jan 14, 2025
7542d98
update machine tests
TheStrgamer Jan 14, 2025
d770c43
updated reservation test
TheStrgamer Jan 14, 2025
fb2e2f1
updated machine and reservation tests
TheStrgamer Jan 14, 2025
db2bd93
code cleanup
TheStrgamer Jan 14, 2025
e34cdae
Added translations
TheStrgamer Jan 30, 2025
29666e6
Merge remote-tracking branch 'origin/main' into course-refactor
TheStrgamer Jan 30, 2025
f183757
Fixed api bug
TheStrgamer Jan 30, 2025
8ad72a2
Removed print
TheStrgamer Jan 30, 2025
3e16ca8
fixed line endings hopefully
TheStrgamer Feb 13, 2025
4959048
Fixed naming in migrations
TheStrgamer Feb 26, 2025
653e3cd
Fixed usage hint and translation typo
TheStrgamer Mar 5, 2025
5597938
fixed some codeclimate cleanup
TheStrgamer Mar 5, 2025
a3cf45d
removed some whitespace
TheStrgamer Mar 5, 2025
98a1bac
Added changes to unreleased in changelog
TheStrgamer Mar 5, 2025
072f3e2
Made some fixes according to review comments
TheStrgamer Mar 29, 2025
22cf71b
Removed unused if statement
TheStrgamer Mar 29, 2025
f790067
Added if statement to prevent when a user has no registered course
TheStrgamer Mar 29, 2025
fcb2fbc
updated more code according to feedback
TheStrgamer Apr 24, 2025
cf22b9d
removed whitespace
TheStrgamer Apr 24, 2025
b25ad62
i removed one too many whitespace lines, whoops
TheStrgamer Apr 24, 2025
3e289a2
fixed bug where course list used old get_permission_names method
TheStrgamer Apr 24, 2025
02c5f78
removed atomic flag
TheStrgamer Apr 24, 2025
42ec054
merged migrations
TheStrgamer May 1, 2025
de27185
Switched to using enum instead of "3DPR" and similar strings
TheStrgamer May 1, 2025
d326bc8
Merge remote-tracking branch 'origin/dev' into course-refactor
TheStrgamer May 3, 2025
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ A summary of changes made to the codebase, grouped per deployment.

### New features

-
- You can now add more permission types that can be used by machine types and courses using the CoursePermission class.
Comment thread
TheStrgamer marked this conversation as resolved.
Outdated

### Improvements

-

### Fixes

-
- Fixed bug where the api call that gets rules for the calender sends wrong data and gets wrong rules as a result.

### Other changes

Expand Down
37 changes: 18 additions & 19 deletions src/checkin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@ def get_context_data(self, **kwargs):
profile, _created = Profile.objects.get_or_create(user=user)

completed_3d_printer = hasattr(user, 'printer_3d_course')
completed_raise3d = completed_3d_printer and user.printer_3d_course.raise3d_course
completed_sla = completed_3d_printer and user.printer_3d_course.sla_course

if completed_3d_printer:
CoursePermission = user.printer_3d_course.course_permissions.model
Comment thread
TheStrgamer marked this conversation as resolved.
Outdated
courses = CoursePermission.objects.exclude(short_name__in=["3DPR", "AUTH"])
Comment thread
TheStrgamer marked this conversation as resolved.
Outdated
course_data = [(user.printer_3d_course.course_permissions.filter(short_name=c.short_name).exists(), c.name) for c in courses]
Comment thread
TheStrgamer marked this conversation as resolved.
Outdated
else:
course_data = []
completed_course_message_structs = [
CompletedCourseMessageStruct(
completed=completed_3d_printer,
Expand All @@ -119,24 +122,20 @@ def get_context_data(self, **kwargs):
"To use a 3D printer, make a reservation in the calendar of one of the 3D printers on the “Reservations” page."
) if completed_3d_printer else None,
),
CompletedCourseMessageStruct(
completed=completed_raise3d,
message=(_("You have completed the Raise3D printer course") if completed_raise3d
else _("You have not taken the Raise3D printer course")),
usage_hint=_(
"To use a Raise3D printer, make a reservation in the calendar of one of the Raise3D printers on the “Reservations” page."
) if completed_raise3d else None,
),
CompletedCourseMessageStruct(
completed=completed_sla,
message=(_("You have completed the SLA 3D printer course") if completed_sla
else _("You have not taken the SLA 3D printer course")),
usage_hint=_(
"To use an SLA 3D printer, make a reservation in the calendar of one of the SLA 3D printers on the “Reservations” page."
) if completed_sla else None,
),
]

for completed, printer_type in course_data:
Comment thread
TheStrgamer marked this conversation as resolved.
Outdated
completed_course_message_structs.append(
CompletedCourseMessageStruct(
completed=completed,
message=_("You have completed the {} course").format(printer_type)
if completed else _("You have not taken the {} course").format(printer_type),
usage_hint=_(
"To use a {}, make a reservation in the calendar of one of the {}s on the “Reservations” page."
).format(printer_type, printer_type) if completed else None,
)
)

""" Commented out because it's currently not in use; see the template code in `profile_detail_internal.html`
user_skills = profile.user_skills.all()
skill_dict = {}
Expand Down
Binary file modified src/locale/nb/LC_MESSAGES/django.mo
Binary file not shown.
Loading