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

Class announcements #26

Merged
merged 8 commits into from
Sep 6, 2023
Merged

Class announcements #26

merged 8 commits into from
Sep 6, 2023

Conversation

krishnans2006
Copy link
Member

Adds functionality for:

  • Class groups with a static message
  • A global group
  • Announcements sent in a group
  • Hoco admin role to manage the hoco site (without superuser perms - e.g. sga)
  • Class group admin to manage class group message/announcements (e.g. class council)

Still needed:

  • Manage class groups without using Django admin
  • Manage hoco admins and class group admins without Django admin

@krishnans2006 krishnans2006 added the enhancement New feature or request label Sep 2, 2023
@krishnans2006 krishnans2006 self-assigned this Sep 2, 2023
Copy link
Member

@alanzhu0 alanzhu0 left a comment

Choose a reason for hiding this comment

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

Very good work in general implementing this functionality. See comments in files.

I have one major architecture comment regarding your ClassGroup model. This implementation seems very "hacky" to me, with the check for the username prefix and "_" for everyone. I would suggest you replace this using Django's built-in Group model and rewrite the logic accordingly. In addition, whenever a user logs in, the following pseudocode could be executed:

group = Group.objects.get(name=user.graduation_year)
if not group.exists():
    Group.objects.create(name=user.graduation_year)
else:
    if group not in user.groups().all():
        user.groups.add(group)

This would also allow for custom groups consisting of certain groups of users, such as SGA or CC. This also removes the need to manually add class groups every year.

Please also squash your commits to preserve only those with clearly defined feature additions.

homecoming/apps/announcements/admin.py Show resolved Hide resolved
homecoming/apps/auth/forms.py Show resolved Hide resolved
homecoming/templates/auth/class_group_form.html Outdated Show resolved Hide resolved
@krishnans2006 krishnans2006 force-pushed the class-announcements branch 2 times, most recently from 198cbaf to 66fcdec Compare September 4, 2023 05:47
@krishnans2006
Copy link
Member Author

I am merging this PR now since the proposed architecture is simple to migrate to and is not affected by the current deployment implementation.

Further changes to the features implemented in this PR will be made directly to the master branch.

@krishnans2006 krishnans2006 merged commit b3cdb26 into master Sep 6, 2023
8 of 14 checks passed
@krishnans2006 krishnans2006 deleted the class-announcements branch September 7, 2023 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants