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

user.py: getting user with existing site group is now possible in get… #154

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

ProfessionalCaddie
Copy link
Contributor

PLEASE ADVISE:
As you can see in my changes, I had to update all poetry dependencies in order to run tests on my machine. I know that is not what we may want but I am new to git so please give me some grace and clarity. Also after this change I WAS NOT able to use commands from the makefile. There might still be a good way to do this but I haven't learned the intricacies.

For the reason above I didn't check the coding guidelines box.

Pull Request

Description

Logic has been added to the test_get_user_by_email function in user.py to be able to add a new user even if a site group already exists for their email

Fixes #

How Has This Been Tested?

I added a test that creates a site group with an email already attached and then creates a user with the same email as the site group. This should prove the case because if another site group was created along side the new user, there would be 2 site groups and I assert that there is only one.

  • Yes

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes

Checklist:

  • My code follows OCF's coding style guidelines
  • [x ] I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • [ x] I have added tests that prove my fix is effective or that my feature works
  • [x ] I have checked my code and corrected any misspellings

…_user_by_email

test_get_user_by_email: new test added which checks new functionality
@peterdudfield
Copy link
Contributor

No problem, Thanks @ProfessionalCaddie for doing all this.

do you mind not commiting any changes to the pyproject.toml files, or the poetry lock files. This should help the CI on our side

I made pyproject.toml the same as the current version 1.0.36
updated poetry.lock to be the same as the main branch
@ProfessionalCaddie
Copy link
Contributor Author

No problem, Thanks @ProfessionalCaddie for doing all this.

do you mind not commiting any changes to the pyproject.toml files, or the poetry lock files. This should help the CI on our side

Hi @peterdudfield, I change pyproject.toml and poetry.lock to be the same as they are in your version of the project. If there is an easier or more preferred way to do this let me know.

@peterdudfield peterdudfield changed the base branch from main to dev September 19, 2024 19:37
@peterdudfield
Copy link
Contributor

Ill merge it to dev incase I need to do any little adjustments

@peterdudfield peterdudfield merged commit 6b66178 into openclimatefix:dev Sep 19, 2024
@peterdudfield peterdudfield mentioned this pull request Sep 19, 2024
Merged
6 tasks
peterdudfield added a commit that referenced this pull request Sep 19, 2024
* user.py: getting user with existing site group is now possible in get… (#154)

* user.py: getting user with existing site group is now possible in get_user_by_email
test_get_user_by_email: new test added which checks new functionality

* Update pyproject.toml

I made pyproject.toml the same as the current version 1.0.36

* Update poetry.lock

updated poetry.lock to be the same as the main branch

---------

Co-authored-by: Peter Dudfield <[email protected]>

* lint

---------

Co-authored-by: Nicholas Tucker <[email protected]>
@peterdudfield
Copy link
Contributor

Thanks @ProfessionalCaddie, ive got this all merged in now

@all-contributors please add @ProfessionalCaddie for code

Copy link
Contributor

@peterdudfield

I've put up a pull request to add @ProfessionalCaddie! 🎉

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.

2 participants