Skip to content

Conversation

@youssefr26
Copy link
Collaborator

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Added registration for new users. I also added the search route for lab managers and the updated create and edit opportunity routes to allow more lab managers to be added.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (if a larger change)
  • New and existing unit tests pass locally with my changes

@youssefr26 youssefr26 linked an issue Nov 12, 2024 that may be closed by this pull request
@deepsource-io
Copy link

deepsource-io bot commented Nov 12, 2024

Here's the code health analysis summary for commits ecfe18b..69d45ae. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 3 occurences introduced
🎯 2 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

json_data = request.get_json()
user.first_name = json_data.get("first_name")
user.last_name = json_data.get("last_name")
user.preferred_name = json_data.get("preferred_name")
Copy link
Member

Choose a reason for hiding this comment

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

For some of these we should add default values for example preferred_name should be blank if empty I believe

user.last_name = json_data.get("last_name")
user.preferred_name = json_data.get("preferred_name")
user.class_year = json_data.get("class_year")
user.profile_picture = json_data.get("profile_pictures")
Copy link
Member

Choose a reason for hiding this comment

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

If not profile picture is added we should add the default we have been using for test users

def registerUser():
user_id = get_jwt_identity()

user = db.session.execute(db.select(User).where(User.email == user_id))
Copy link
Member

Choose a reason for hiding this comment

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

We should be making a new User instead of requesting an existing one, all logic for making a user should be here.

email=user_id,
first_name=json_data.get("first_name"),
last_name=json_data.get("last_name"),
preferred_name=json_data.get("preferred_name"),
Copy link
Member

Choose a reason for hiding this comment

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

We should add major as well

Copy link
Member

@RafaelCenzano RafaelCenzano left a comment

Choose a reason for hiding this comment

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

LGTM

@RafaelCenzano RafaelCenzano merged commit 9b01757 into main Nov 15, 2024
4 of 5 checks passed
@RafaelCenzano RafaelCenzano deleted the 236-registration-page branch November 15, 2024 23:37
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.

Registration page

3 participants