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

graph/education: Check school number for duplicates before adding a school #7351

Merged
merged 7 commits into from
Sep 27, 2023

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented Sep 25, 2023

Fixes https://github.com/owncloud/enterprise/issues/6051

Also contains a few minor cleanups. E.g. to make returned errors more consistent.

@rhafer rhafer requested review from micbar and kobergj September 25, 2023 15:59
@rhafer rhafer self-assigned this Sep 25, 2023
@rhafer rhafer force-pushed the enterprise/6051 branch 3 times, most recently from e00db0f to b2c47ad Compare September 26, 2023 12:56
Copy link
Collaborator

@kobergj kobergj left a comment

Choose a reason for hiding this comment

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

Picky comment as always

services/graph/pkg/identity/ldap_education_school.go Outdated Show resolved Hide resolved
An LDAP Modify operation never returns LDAPResultEntryAlreadyExists errors.
That error can only happen for LDAPAdd or LDAPModifyDN.
Sometimes we explicit need to lookup by number and not numberOrID
- Use var for common errors
- Add the addition error message to the Error() output of errorcode.Error
- in PatchEducationSchool() use errorcode.RenderError() to turn the errorcode
  in to the right HTTP Status (instead of return 500 always)
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

70.8% 70.8% Coverage
0.0% 0.0% Duplication

@micbar
Copy link
Contributor

micbar commented Sep 27, 2023

Please backport after merging to stable-4.0 including the changelog

@rhafer rhafer merged commit 4465c93 into owncloud:master Sep 27, 2023
2 checks passed
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.

3 participants