Skip to content

Commit

Permalink
- Fix Upload function call
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Feb 6, 2019
1 parent cbaf685 commit 63eb117
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions strt/serapide_core/api/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def mutate_and_get_payload(cls, root, info, **input):
# ############################################################################ #
# Upload 'Risorse' Mutations
# ############################################################################ #
class UploadBaseMixIn(graphene.Mutation):
class UploadBaseBase(graphene.Mutation):

class Arguments:
codice_piano = graphene.String(required=True)
Expand Down Expand Up @@ -862,8 +862,11 @@ def handle_uploaded_data(self, file, media_prefix, fase, tipo_file=None):
os.remove(_destination.name)
return resources

def mutate(self, info, file, **input):
pass


class UploadFile(UploadBaseMixIn):
class UploadFile(UploadBaseBase):

piano_aggiornato = graphene.Field(PianoNode)
success = graphene.Boolean()
Expand Down Expand Up @@ -893,7 +896,7 @@ def mutate(self, info, file, **input):
return GraphQLError(_("Not Allowed"), code=405)


class UploadRisorsaVAS(UploadBaseMixIn):
class UploadRisorsaVAS(UploadBaseBase):

success = graphene.Boolean()
procedura_vas_aggiornata = graphene.Field(ProceduraVASNode)
Expand Down Expand Up @@ -923,7 +926,7 @@ def mutate(self, info, file, **input):
return GraphQLError(_("Not Allowed"), code=405)


class DeleteRisorsaMixIn(graphene.Mutation):
class DeleteRisorsaBase(graphene.Mutation):

class Arguments:
risorsa_id = graphene.ID(required=True)
Expand All @@ -946,7 +949,7 @@ def handle_downloaded_data(self, risorsa):
return False


class DeleteRisorsa(DeleteRisorsaMixIn):
class DeleteRisorsa(DeleteRisorsaBase):

success = graphene.Boolean()
piano_aggiornato = graphene.Field(PianoNode)
Expand All @@ -971,7 +974,7 @@ def mutate(self, info, **input):
return GraphQLError(_("Not Allowed"), code=405)


class DeleteRisorsaVAS(DeleteRisorsaMixIn, graphene.Mutation):
class DeleteRisorsaVAS(DeleteRisorsaBase):

success = graphene.Boolean()
procedura_vas_aggiornata = graphene.Field(ProceduraVASNode)
Expand Down

0 comments on commit 63eb117

Please sign in to comment.