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

Fix returning deleted admin #243

Merged
merged 1 commit into from
Nov 11, 2023
Merged

Conversation

BentiGorlich
Copy link
Member

  • the findAdmin method didn't filter for isDeleted, yet

Fix #67

@BentiGorlich BentiGorlich added bug Something isn't working backend Backend related issues and pull requests labels Nov 11, 2023
@BentiGorlich BentiGorlich self-assigned this Nov 11, 2023
- the `findAdmin` method didn't filter for `isDeleted`, yet
@BentiGorlich BentiGorlich merged commit 5a6327a into main Nov 11, 2023
7 checks passed
@BentiGorlich BentiGorlich deleted the fix_returning_deleted_admin branch November 11, 2023 00:25
->getQuery()
->getResult()[0];
Copy link
Member

Choose a reason for hiding this comment

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

I know I'm late but I wonder why this didn't have a limit applied to it 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

I mean how many admins will an instance have :D
I'd say most instances are running with exactly one admin

Copy link
Member

Choose a reason for hiding this comment

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

hmm, i wonder what happens where there's more than 1, though... it might hose whatever is expecting only 1 like assigning a magazine owner? you're probably right about there usually only being 1 admin, but these edge cases might come back to bite later.

Copy link
Member

@e-five256 e-five256 Nov 11, 2023

Choose a reason for hiding this comment

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

It's not important, I just feel like if you already know the limitations you expect, it's good to declare, so I might want to add ->setMaxResults(1) to this or something, but also like I said not important

this is fine, the function always returns 1 result, the sql might just return more rows than you use, really not a big deal

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean how many admins will an instance have :D I'd say most instances are running with exactly one admin

Mine has three

@BentiGorlich
Copy link
Member Author

BentiGorlich commented Nov 11, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related issues and pull requests bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New magazines after a search are created with deleted user and related problems
4 participants