Skip to content

Commit

Permalink
Merge pull request #975 from eciis/super-institution
Browse files Browse the repository at this point in the history
Refact the method get_deciis
  • Loading branch information
mayzabeel authored Apr 9, 2018
2 parents 38e2c2f + f78ae96 commit 5716e9c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion backend/handlers/institution_followers_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def delete(self, user, url_string):
Utils._assert(institution.name == 'Ministério da Saúde',
"The institution can not be unfollowed", NotAuthorizedException)

Utils._assert(institution.name == 'Departamento do Complexo Industrial e Inovação em Saúde',
Utils._assert(institution.trusted,
"The institution can not be unfollowed", NotAuthorizedException)

if(not type(institution) is Institution):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def test_post(self, verify_token, send_invite):
self.new_inst = mocks.create_institution()
self.new_inst.name = "Departamento do Complexo Industrial e Inovação em Saúde"
self.new_inst.acronym = "DECIIS"
self.new_inst.trusted = True
self.new_inst.address = self.address
self.new_inst.put()

Expand Down
6 changes: 1 addition & 5 deletions backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,9 @@ def get_health_ministry():
query = Institution.query(Institution.name == "Ministério da Saúde", Institution.acronym == "MS")
return query.get()

"""TODO: Refactor this function to get the DECIIS Institution, making a get for
the institution with that field trusted is equal to true.
And certificate that DECIIS is the unique institution trusted in system.
@author: Mayza Nunes 05/04/2018"""
def get_deciis():
"""Get health ministry institution."""
query = Institution.query(Institution.name == "Departamento do Complexo Industrial e Inovação em Saúde", Institution.acronym == "DECIIS")
query = Institution.query(Institution.trusted == True)
return query.get()

def json_response(method):
Expand Down

0 comments on commit 5716e9c

Please sign in to comment.