Skip to content

Commit

Permalink
User in _get_codes from re-query
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Dec 14, 2023
1 parent d025f77 commit ffe8117
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion aiidalab_widgets_base/computational_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def __init__(

self._setup_new_code_output = ipw.Output(layout={"width": self._output_width})

self._default_user_email = orm.User.objects.get_default().email

children = [
ipw.HBox([self.code_select_dropdown, self.btn_setup_new_code]),
self._setup_new_code_output,
Expand All @@ -124,7 +126,15 @@ def __init__(
def _get_codes(self):
"""Query the list of available codes."""

user = orm.User.collection.get_default()
user = (
orm.QueryBuilder()
.append(
orm.User,
filters={"email": self._default_user_email},
)
.one()[0]
)

filters = (
{"attributes.input_plugin": self.default_calc_job_plugin}
if self.default_calc_job_plugin
Expand Down

0 comments on commit ffe8117

Please sign in to comment.