def set_score(cls, reportId, score): data = base.find_one("reports", {"reportId": reportId}) if data is not None: query = { "filter": { "reportId": reportId }, "update": { "$set": { "reportScore": score } } } base.update("reports", query) return True else: return False
def get_message(cls, messageId): data = Database.find_one("chat", {"messageId": messageId}) if data is not None: return data
def get_user_message_by_replymessageId(cls, messageId): data = Database.find_one("chat", {"replymessageId": messageId}) if data is not None: return data
def get_notification_by_id(cls, notiId): data = base.find_one("notification", {"notiId": reportId}) if data is not None: return data
def get_only_email(self, email): data = Database.find_one("users", {"email": email}) if data is not None: return data['email'] else: return None
def get_id_by_email(cls, email): data = Database.find_one("users", {"email": email}) return data["_id"]
def get_by_id(cls, _id): data = Database.find_one("users", {"_id": _id}) if data is not None: return data
def get_password_hash(cls, email): data = Database.find_one("users", {"email": email}) if data is not None: return data["password"]
def get_by_email(cls, email): # get user by filling email data = Database.find_one("users", {"email": email}) if data is not None: return data
def get_report(cls, reportId): data = base.find_one("reports", {"reportId": reportId}) if data is not None: return data
def get_report_level(cls, reportId): data = base.find_one("reports", {"reportId": reportId}) if data is not None: return data['reportLevel']
def get_priviliges(cls, reportId): data = base.find_one("reports", {"reportId": reportId}) if data is not None: return data['getprivilege']
def get_attack_complexity(cls, reportId): data = base.find_one("reports", {"reportId": reportId}) if data is not None: return data['AttackComplexity']
def get_attack_vector(cls, reportId): data = base.find_one("reports", {"reportId": reportId}) if data is not None: return data['AttackVector']