-
Notifications
You must be signed in to change notification settings - Fork 0
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
[ENG-5430] GV get_addon feature flipping #211
base: develop
Are you sure you want to change the base?
Conversation
f43f30c
to
73cc7f2
Compare
…penScience/osf.io into gv-files-api-endpoint * 'gv-files-api-endpoint' of https://github.com/CenterForOpenScience/osf.io: WIP format kwargs # Conflicts: # addons/box/models.py # osf/models/mixins.py
addons/box/models.py
Outdated
for key, value in data_from_gv['user_settings'].items(): | ||
setattr(settings_obj, key, value) | ||
|
||
settings_obj.save() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to save, but do call full_clean
to ensure everything is valid
osf/models/mixins.py
Outdated
|
||
if waffle.flag_is_active(request, features.ENABLE_GV): | ||
resp = requests.get( | ||
f'{settings.DOMAIN}v1/resource-references/{self.uri}/authorized_storage_accounts/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get all configured storage addons for a node (two calls):
v1/resource_references/?filter[resource_uri]={self.uri}
->data[0][relationships][configured_storage_addons][links][self]
To get details on a specific configured addon (name
== id
)
v1/configured-storage-addons/{name}/
addons/box/models.py
Outdated
settings_obj = UserSettings.objects.get(owner=owner) | ||
except ObjectDoesNotExist: | ||
return None # or handle the case where the settings object does not exist | ||
settings_obj = UserSettings.objects.get_or_create(owner=owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drive by: this belongs in NodeSettings, the UserSettings rarely contain anything consequential for us (pretty much just a super janky dict mapping nodes to external accounts that we've replaced with actual database relationships on the gv side)
b552211
to
401d8c9
Compare
38dfed4
to
5fdb5b7
Compare
541a161
to
ba28a9e
Compare
606604c
to
37b3d86
Compare
37b3d86
to
5768286
Compare
Purpose
Allows OSF legacy features to sync with GV addon system.
Changes
QA Notes
Please make verification statements inspired by your code and what your code touches.
What are the areas of risk?
Any concerns/considerations/questions that development raised?
Documentation
Side Effects
Ticket
https://openscience.atlassian.net/browse/ENG-5430