Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage requirements refactor #749

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Usage requirements refactor #749

wants to merge 18 commits into from

Conversation

TheStrgamer
Copy link

Proposed changes

Machine types and courses use a new permission class instead of boolean for usage requirements

Areas to review closely

Checklist

(If any of the points are not relevant, mark them as checked)

  • Remembered to run the makemigrations, makemessages and compilemessages management commands and committed any changes that should be included in this PR
  • Created tests that fail without the changes, if relevant/possible
  • Manually tested that the website UI works as intended with different device layouts
    • (Most common is to test with typical screen sizes for mobile (320-425 px), tablet (768 px) and desktop (1024+ px), which can easily be done with your browser's dev tools)
  • Manually tested that everything works as intended when logged in as different users locally
    • (This can be e.g. anonymous users (i.e. not being logged in), "normal" non-member users, members of different committees, and superusers)
  • Made sure that your code conforms to the code style guides
    • (It's not intended that you read through this whole document, but that you get yourself an overview over its contents, and that you use it as a reference guide / checklist while taking a second look at your code before opening a pull request)
  • Attempted to minimize the number of common code smells
    • (See the comment for the previous checkbox)
  • Added sufficient documentation - e.g. as comments, docstrings or in the README, if suitable
  • Added your changes to the "Unreleased" section of the changelog - mainly the changes that are of particular interest to users and/or developers, if any
  • Added a "Deployment notes" section above, if anything out of the ordinary should be done when deploying these changes to the server
  • Structured your commits reasonably

@TheStrgamer TheStrgamer added the feature New functionality on the page label Jan 30, 2025
@TheStrgamer TheStrgamer requested a review from Gunvor4 January 30, 2025 19:56
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 77.59434% with 95 lines in your changes missing coverage. Please review.

Project coverage is 88.18%. Comparing base (a4de522) to head (8ad72a2).

Files with missing lines Patch % Lines
src/checkin/views.py 39.69% 79 Missing ⚠️
src/make_queue/models/machine.py 91.47% 11 Missing ⚠️
src/make_queue/models/course.py 95.52% 3 Missing ⚠️
src/make_queue/forms/course.py 75.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #749      +/-   ##
==========================================
+ Coverage   88.17%   88.18%   +0.01%     
==========================================
  Files         152      152              
  Lines        6198     6198              
==========================================
+ Hits         5465     5466       +1     
+ Misses        733      732       -1     
Files with missing lines Coverage Δ
src/groups/admin.py 100.00% <100.00%> (ø)
src/make_queue/admin.py 100.00% <100.00%> (ø)
src/make_queue/api/views.py 96.87% <ø> (ø)
src/make_queue/forms/course.py 80.85% <75.00%> (-2.08%) ⬇️
src/make_queue/models/course.py 95.52% <95.52%> (+0.69%) ⬆️
src/make_queue/models/machine.py 91.47% <91.47%> (+3.23%) ⬆️
src/checkin/views.py 39.69% <39.69%> (-0.79%) ⬇️

Copy link
Member

@ddabble ddabble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you've changed all line endings from \n (the Linux/Unix default) to \r\n (the Windows default) 😅 The default Git setting on Windows is to convert all line endings to \n when committing, and you can reset that setting to the default value by running git config --global core.autocrlf true 🙂 See the GitHub docs on line endings for more details.

@ddabble
Copy link
Member

ddabble commented Jan 30, 2025

Btw, do you want my review on your code? It will be detailed, but I won't do it to enforce some code standard on this repo; rather, I'll to try to teach conventions and good coding practices that will be useful in a programming career 🙂

No worries if you're not interested 😊

@TheStrgamer
Copy link
Author

We need these changes as soon as possible for the new printers, but i'm still interested in the review for future improvement and learning. Thanks

@ddabble
Copy link
Member

ddabble commented Feb 6, 2025

We need these changes as soon as possible for the new printers

Worst case, it's always possible to just check out this branch on the server, if needed for whatever reason 🤠

But anyway: First, it would be great if you could convert the line endings, like I mentioned earlier, as the diff is pretty unreadable 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality on the page
Projects
Status: Ready for Review
Development

Successfully merging this pull request may close these issues.

2 participants