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

BF(workaround): to avoid crash for user lacking metadata - return INCOMPLETE #1086

Merged
merged 1 commit into from
May 6, 2022

Conversation

yarikoptic
Copy link
Member

Underlying issue is somewhere in the logic/instructions so that locally created
user lacks .metadata somehow, although it seems to be available within /admin
interface among Users table for that user. So must be some glue missing etc.
With this workaround it should still work ok, but would avoid crashing
and due to INCOMPLETE I would expect that user lacking any super powers
otherwise granted

Note: pycharm checker highlights .metadata since it is not defined in User class at all. Is it indeed just ducktyped into it?

Workaround for #1085

…OMPLETE

Underlying issue is somewhere in the logic/instructions so that locally created
user lacks .metadata somehow, although it seems to be available within /admin
interface among Users table for that user.  So must be some glue missing etc.
With this workaround it should still work ok, but would avoid crashing
and due to INCOMPLETE I would expect that user lacking any super powers
otherwise granted

Workaround for #1085
if metadata:
return metadata.status
logger.error("User %s lacks .metadata. Returning user's status as INCOMPLETE", user)
return UserMetadata.Status.INCOMPLETE
Copy link
Member Author

Choose a reason for hiding this comment

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

@djarecka make it here

Suggested change
return UserMetadata.Status.INCOMPLETE
return UserMetadata.Status.APPROVED

if you want to allow that user to be able to click 'Create dataset' etc

@yarikoptic
Copy link
Member Author

since I keep getting annoyed to need this patch to do anything with local instance, I will merge this PR although a proper solution for #1085 is yet to be developed to populate .metadata properly for a local user.

@yarikoptic yarikoptic merged commit 9509dc4 into master May 6, 2022
@yarikoptic yarikoptic deleted the bf-user-no-metadata branch May 6, 2022 20:59
@dandibot
Copy link
Member

🚀 PR was released in v0.2.21 🚀

@dandibot dandibot added the released This issue/pull request has been released. label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants