Exemple #1
0
def delete_user_data():
    usermail = g.user.mail
    fas_user = queries.get_user_by_mail(db, usermail).first()
    bz_user = queries.get_bz_user(db, usermail)
    contact_email = queries.get_contact_email(db, usermail)

    if bz_user is not None:
        anonymous = create_anonymous_bzuser(db, uid=-1)
        delete_bugzilla_user(db, bz_user.id, anonymous.id)
        db.session.delete(bz_user)

    if fas_user is not None:
        queries.get_reportarchives_by_username(db, fas_user.username).delete(False)
        queries.get_problemreassigns_by_username(db, fas_user.username).delete(False)

    if contact_email is not None:
        queries.get_reportcontactmails_by_id(db, contact_email.id).delete(False)
        db.session.delete(contact_email)

    # Sign out user before deleting his account
    session.pop("openid", None)
    flash(u"You were signed out.", category='info')
    db.session.delete(fas_user)
    db.session.commit()

    return redirect(oid.get_next_url())
Exemple #2
0
 def reports(self):
     username = self.user_info['Username']
     user_reports = queries.get_reportarchives_by_username(
         self.db, username).all()
     return [{
         "Report": get_url("reports", report.report_id),
         "Date": str(report.date)
     } for report in user_reports]
Exemple #3
0
Fichier : user.py Projet : abrt/faf
 def reports(self):
     username = self.user_info['Username']
     user_reports = queries.get_reportarchives_by_username(self.db, username).all()
     return [{"Report": get_url("reports", report.report_id),
              "Date": str(report.date)}
             for report in user_reports]