Skip to content

Commit

Permalink
[HUE-7919] oozie error 'NoneType' object has no attribute 'is_superus…
Browse files Browse the repository at this point in the history
…er' (#775)

Here are my reappearance steps:
1. create a shell or spark workflow ,(type as Pig/Sqoop/Dist/Shell/MapReduce/Java/Spark , also met issues)
2. create a schedule of this workflow.
3. submit schedule
would get HUE-7919 problem.

In Class Coordinator of hue/apps/oozie/src/oozie/models2.py , 
```
@Property
def workflow(self)
```
initialize a Workflow without 'user' parameter, then the workflow.user=None, when passing to check can_read/write_or_exception(), would  raise  'NoneType' object has no attribute 'is_superuser'
  • Loading branch information
TopCaver authored and romainr committed Jan 2, 2019
1 parent 52e8b9a commit 4db8f45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/oozie/src/oozie/models2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3502,12 +3502,12 @@ def workflow(self):
if self.data['properties']['document']:
document = Document2.objects.get_by_uuid(user=self.document.owner, uuid=self.data['properties']['document'])
wf_doc = WorkflowBuilder().create_workflow(document=document, user=self.document.owner, managed=True)
wf = Workflow(data=wf_doc.data)
wf = Workflow(data=wf_doc.data,user=self.document.owner)
wf_doc.delete()
return wf
else:
wf_doc = Document2.objects.get_by_uuid(user=self.document.owner, uuid=self.data['properties']['workflow'])
return Workflow(document=wf_doc)
return Workflow(document=wf_doc,user=self.document.owner)

def get_absolute_url(self):
return reverse('oozie:edit_coordinator') + '?coordinator=%s' % self.id
Expand Down

0 comments on commit 4db8f45

Please sign in to comment.