示例#1
0
 def test_isAuthor(self):
     db.isAuthor(1, 'riz')
     assert True
示例#2
0
def unShareNote(id):
    if db.isAuthor(id, getUser()):
        db.updateShare(id, 0)
        return {'ack': 1}
    else:
        return {'ack': 0, 'msg': 'You do not have permission update this note'}
示例#3
0
def deleteNote(id):
    if db.isAuthor(id, getUser()):
        db.deleteNote(id)
        return {'ack': 1}
    else:
        return {'ack': 0, 'msg': 'You do not have permission delete this note'}
示例#4
0
def updateNote(id):
    if db.isAuthor(id, getUser()):
        db.updateNote(id, request.forms.get('time'), request.forms.get('text'))
        return {'ack': 1}
    else:
        return {'ack': 0, 'msg': 'You do not have permission update this note'}
示例#5
0
 def test_isAuthor(self):
     db.isAuthor(1, "riz")
     assert True