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

Add support for cops member specific user profiles. #42

Open
m-e-l-u-h-a-n opened this issue May 16, 2021 · 5 comments
Open

Add support for cops member specific user profiles. #42

m-e-l-u-h-a-n opened this issue May 16, 2021 · 5 comments
Labels
good first issue Good for newcomers

Comments

@m-e-l-u-h-a-n
Copy link
Member

m-e-l-u-h-a-n commented May 16, 2021

COPS members will have a special profiles. So probably for now this can be done by a simple is_cops_member(boolean field) and cops_group(character field with choices as 1. SDG 2. CPG 3. IG 4. INFOSEC). Any adminstrative powers if required can be added later on based on discussion.

@m-e-l-u-h-a-n m-e-l-u-h-a-n added the good first issue Good for newcomers label May 16, 2021
@sahilsaini1107
Copy link

Hi, i am sahil saini and i am interested in working on this

@m-e-l-u-h-a-n
Copy link
Member Author

Sure you may go ahead and ask any doubts in the discord channel or here.

@Vanshika-kejriwal
Copy link

I am Vanshika and iam interested to work on this issue

@king-11
Copy link
Member

king-11 commented Sep 26, 2021

Hey @Vanshika-kejriwal as far as I am aware for now your tasks should be:

  • add new fields as provided in the OP
  • make new migrations
  • commit changes and make a PR

If there are any updates on how we want to handle this issue it will be informed to you by @shubhanshu02 or @m-e-l-u-h-a-n

Regarding group names there has been a change we should have choices for roles as:

  • Software Development Group SDG
  • Competitive Programming Group CPG
  • Intelligence Group IG
  • InfoSec Group ISG

@shubhanshu02
Copy link
Member

Hi @Vanshika-kejriwal! Great to see your interest in this issue. As @king-11 already mentioned the tasks, here are some more details about the fields.

The boolean field is_cops_member has a default value False and cops_group is a character field which we can fill from the given four choices similar to the linked code snippet below. If we make this field nullable, then cops_group will be set null/None for the case when the user is not a COPS member. Else we'll need to add another choice, 'None', to the given options. I guess the prior one will be better.

class User(AbstractUser):
with open('authentication/college_list.json') as f:
college_json = json.load(f)
COLLEGE_NAMES = [(college["name"], college["name"]) for college in college_json]
college = models.CharField(choices=COLLEGE_NAMES, max_length=255)
uid = models.CharField(primary_key=True, max_length=64)

If you have some ideas to add or face any problems, feel free to discuss them here.

@king-11 @m-e-l-u-h-a-n any suggestions/corrections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants