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

[21.09] Catch exceptions when job.user is None #13179

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

rhpvorderman
Copy link
Contributor

prevents the following error:

galaxy.web.framework.decorators ERROR 2022-01-17 14:52:09,619 [p:18,w:1,m:0] [uWSGIWorker1Core1] Uncaught exception in exposed API method:
Traceback (most recent call last):
File "lib/galaxy/web/framework/decorators.py", line 282, in decorator
rval = func(self, trans, *args, **kwargs)
File "lib/galaxy/webapps/galaxy/api/jobs.py", line 113, in index
j['user_email'] = job.user.email
AttributeError: 'NoneType' object has no attribute 'email'

(Please replace this header with a description of your pull request. Please include BOTH what you did and why you made the changes. The "why" may simply be citing a relevant Galaxy issue.)
(If fixing a bug, please add any relevant error or traceback)
(For UI components, it is recommended to include screenshots or screencasts)

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

@github-actions github-actions bot added this to the 22.01 milestone Jan 17, 2022
@mvdbeek
Copy link
Member

mvdbeek commented Jan 17, 2022

Could you take the logic in https://github.com/mvdbeek/galaxy/blob/d53cd3964d3ba69988f962a1347a1ca534063156/lib/galaxy/jobs/__init__.py#L2154-L2159 and move it as a user_email property to the Job class in lib/galaxy/model/__init__.py and then replace all usage of job.user.email with job.user_email ?

rhpvorderman and others added 2 commits January 18, 2022 14:21
prevents the following error:

galaxy.web.framework.decorators ERROR 2022-01-17 14:52:09,619 [p:18,w:1,m:0] [uWSGIWorker1Core1] Uncaught exception in exposed API method:
Traceback (most recent call last):
  File "lib/galaxy/web/framework/decorators.py", line 282, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "lib/galaxy/webapps/galaxy/api/jobs.py", line 113, in index
    j['user_email'] = job.user.email
AttributeError: 'NoneType' object has no attribute 'email'
@mvdbeek mvdbeek changed the base branch from dev to release_21.09 January 18, 2022 13:21
@mvdbeek mvdbeek changed the title Catch exceptions when job.user is None [21.09] Catch exceptions when job.user is None Jan 18, 2022
@mvdbeek mvdbeek closed this Jan 18, 2022
@mvdbeek mvdbeek reopened this Jan 18, 2022
@mvdbeek mvdbeek merged commit 043371e into galaxyproject:release_21.09 Jan 18, 2022
@rhpvorderman
Copy link
Contributor Author

Hi, sorry for not checking back in yesterday, I had a busy schedule. Thanks @mvdbeek for finishing all the work!

@rhpvorderman rhpvorderman deleted the patch-5 branch January 19, 2022 06:33
@mvdbeek
Copy link
Member

mvdbeek commented Jan 19, 2022

Np, thanks for getting it started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants