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

Added all previous GSOC organizations to organizations #3285

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tsu-ki
Copy link
Contributor

@tsu-ki tsu-ki commented Jan 27, 2025

Closes: #3264
Work-in progress PR
(I haven't added consistent UI yet so the cards aren't displayed properly, please don't mind that)

Screen.Recording.2025-01-28.at.12.56.43.AM.mov

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Jan 27, 2025

@DonnieBLT sir, while adding the organizations, I encountered the following problem:
Since, an organization's domains are linked to their BLT profile, and not their slug. I'll have to either create a new slug field in Domains model in models.py file or I'll have to manually register each of the organizations domain and then link their domain, so as to create their BLT profile.
Can you please guide me on how should I pursue this further ahead? thank you.

@JisanAR03
Copy link
Contributor

Approach to Follow:

  1. Since an organization's domains are linked to their BLT profile, you need to update the model first.

  2. As we haven’t linked domains to BLT profiles yet, we need to be very cautious with the code. Initially, when creating an organization manually, we will not assign any specific user to it.

  3. In the future, if a manager or admin comes to BLT to create an organization account, we will check whether their organization (without a user) already exists in our system. This verification will be done using their email address.

  4. If the organization already exists, we will ask them to confirm ownership. This can be done via OTP verification or by checking whether the user is already verified.

  5. Once verified, the user can then be linked to their organization.

Points to Consider:

  1. First, remove the website/fixtures/merged_organizations.json file, as it is not a robust approach. Instead, write a script to fetch the data and apply conditions to ensure all data is updated yearly. Also, consider the script's complexity and execution time.

  2. Make changes to the domainlist.html file and the organization view file only if absolutely necessary. For now, I believe you should focus only on making changes to the organization creation process and ensuring the necessary condition checks mentioned earlier are implemented.

@DonnieBLT , could you please provide your feedback on this suggestion? Also, let me know if there's anything you'd like to add or remove.

@tsu-ki , if you have any questions, feel free to ask—I'm here !

@DonnieBLT
Copy link
Collaborator

Sounds good!

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Jan 27, 2025

Approach to Follow:

  1. Since an organization's domains are linked to their BLT profile, you need to update the model first.
  2. As we haven’t linked domains to BLT profiles yet, we need to be very cautious with the code. Initially, when creating an organization manually, we will not assign any specific user to it.
  3. In the future, if a manager or admin comes to BLT to create an organization account, we will check whether their organization (without a user) already exists in our system. This verification will be done using their email address.
  4. If the organization already exists, we will ask them to confirm ownership. This can be done via OTP verification or by checking whether the user is already verified.
  5. Once verified, the user can then be linked to their organization.

Points to Consider:

  1. First, remove the website/fixtures/merged_organizations.json file, as it is not a robust approach. Instead, write a script to fetch the data and apply conditions to ensure all data is updated yearly. Also, consider the script's complexity and execution time.
  2. Make changes to the domainlist.html file and the organization view file only if absolutely necessary. For now, I believe you should focus only on making changes to the organization creation process and ensuring the necessary condition checks mentioned earlier are implemented.

@DonnieBLT , could you please provide your feedback on this suggestion? Also, let me know if there's anything you'd like to add or remove.

@tsu-ki , if you have any questions, feel free to ask—I'm here !

@JisanAR03 thank you so much for your extensive explanation, it cleared a lot of things for me.
Firstly, I would like to address my approach to solving this. I was considering re-introducing slug field and using conditional statements, where if an org's domain isn't linked to their BLT profile page yet, a slug is created for that org and instead that slug can be linked to their profile page.
So, following route would be followed for gsoc orgs present under website/fixtures/merged_organizations.json:
org url fetched from json file -> check if their domain is linked or not -> if not, slug is created for this org, and instead slug is linked to their BLT page.
Secondly, I created multiple scripts to scrap org information but since gsoc archive doesn't contain information about orgs which participated before 2016, I had to scrap per year information, which didn't include data fields such as logo and correct urls. website/fixtures/merged_organizations.json was formed after combining multiple json files.
I tried using Bing API, which is professionally used for web scraping, but it couldn't provide satisfactory results and took too much time to execute. plus, the cost be a factor aswell. I do agree that it's not a robust approach but I haven't been able to find a better approach yet. If you can help me with this, I would be very grateful.

@DonnieBLT sir, please review this and guide me on this, thank you!

@JisanAR03
Copy link
Contributor

@tsu-ki , please consider :

  1. verifying an organization before linking it to a user as i mention before, ensuring accurate mapping.

2 . Using slugs as a workaround for missing domain links might lead to inconsistencies in future updates. and keeps the organization-user mapping clean without introducing unnecessary fields.

  1. focus on refining the organization creation process with careful condition checks.

  2. Give me the script you were testing with. Let me check. If I can't do anything with that, then we will go with your approach.

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Jan 28, 2025

@tsu-ki , please consider :

  1. verifying an organization before linking it to a user as i mention before, ensuring accurate mapping.

2 . Using slugs as a workaround for missing domain links might lead to inconsistencies in future updates. and keeps the organization-user mapping clean without introducing unnecessary fields.

  1. focus on refining the organization creation process with careful condition checks.
  2. Give me the script you were testing with. Let me check. If I can't do anything with that, then we will go with your approach.

I've shared the script with you on slack, please look into it.
I'll create a minimal process which checks whether an org exists in the DB or not, if it does then whether it's domain is linked or not.
I'll have to find my way around for saving the JSON file organisations and using their domains correctly. thank you for your help!

@tsu-ki
Copy link
Contributor Author

tsu-ki commented Jan 28, 2025

@JisanAR03 @DonnieBLT I've created a seperate class that handles unverified organizations using path("domain/<str:org_name>/unverified", UnverifiedDomainView.as_view(), name="domain_unverified"), route.

  • Both verified(organizations whose domains have been linked with their BLT profiles and unverified(organizations without verification); are displayed on Organizations page, unverified org having an unverified tag attached.
  • An unverified organization is determined as unverified, if it does not exist in DB and has been fetched from another source.
  • When user redirects to an unverified organization's domain, they're taken to a different page, which shows that they're unverified.
  • Incorporating this required changes only in organizations.py, domain_list.html, .urls.py and creating a new template file.
    Please review this approach and suggest how can I improve, make changes to it. thank you!
Screen.Recording.2025-01-28.at.7.21.44.PM.mov

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

Successfully merging this pull request may close these issues.

Add all previous GSOC organizations to organizations
3 participants