def test_get_bug_wrng_api_k(self):
     """ Wrong API Key, it should raise an Error"""
     # Load our agent for BMO
     bmo = BMOAgent('wrong_api_key_test')
     # Get the bugs from the api
     bug = bmo.get_bug(656222)
     print bug
 def test_get_bug_wrng_api_k(self):
     """ Wrong API Key, it should raise an Error"""
     # Load our agent for BMO
     bmo = BMOAgent('wrong_api_key_test')
     # Get the bugs from the api
     bug = bmo.get_bug(656222)
     print bug
Beispiel #3
0
def signup():
    error = None
    try:
        initializeSession()
        if request.method == 'GET':
            products = Product.query.order_by(Product.description).all()
            return render_template('signup.html', products=products)
        else:
            email = request.form['email']
            user = User.query.filter_by(email=email).first()

            if user is not None:
                raise Exception('User email already exists')

            password = request.form['password']
            if email == '' or password == '':
                raise Exception('User must have an email and a password!')

            if password != request.form['confirmpassword']:
                raise Exception('Please re-enter the same password')

            try:
                # verify email and password
                bmo = BMOAgent(email, password)
                bug = bmo.get_bug('80000')
            except Exception, e:
                raise Exception(
                    'Failed to verify Bugzilla account on Bugzilla server:' +
                    e)

            #generate salt, hash and store to db
            salt = os.urandom(8)
            m = hashlib.md5()
            m.update(salt)
            m.update(password)
            _hash = m.digest()
            user = User(email=email,
                        _hash=_hash.encode('base64'),
                        salt=salt.encode('base64'))
            db.session.add(user)
            db.session.commit()
            print 'creating'
            create_view(user, request)

            return loginSession(user, password)
    except Exception, e:
        print e
        if error is None:
            error = e
Beispiel #4
0
def edit_account():
    error = ''
    message = ''
    email = ''
    try:
        email = request.form['email']
        password = request.form['password']
        user = User.query.filter_by(email=session['user'].email).first()
        print user.email

        if verify_account(user, password):
            newpassword = request.form['newpassword']
            print 'shit'
            if newpassword != request.form['confirmpassword']:
                raise Exception('Please re-enter the same password')
            print 'dshit'
            if newpassword == '':
                bmo = BMOAgent(email, password)
                bug = bmo.get_bug('80000')
            else:
                session['bmo'] = bmo = BMOAgent(email, newpassword)
                bug = bmo.get_bug('80000')
                salt = os.urandom(8)
                m = hashlib.md5()
                m.update(salt)
                m.update(password)
                _hash = m.digest()
                user.hash = _hash.encode('base64')
                user.salt = salt.encode('base64')

            user.email = email
            db.session.commit()
            session['user'] = user
            message = 'Account updated'
    except Exception, e:
        error = e
Beispiel #5
0
def signup():
    error = None
    try:
        initializeSession()
        if request.method == 'GET':
            products = Product.query.order_by(Product.description).all()
            return render_template('signup.html', products=products)
        else:
            email = request.form['email']
            user = User.query.filter_by(email=email).first()

            if user is not None:
                raise Exception('User email already exists')

            password = request.form['password']
            if email == '' or password == '':
                raise Exception('User must have an email and a password!')

            if password != request.form['confirmpassword']:
                raise Exception('Please re-enter the same password')

            try:
                # verify email and password
                bmo = BMOAgent(email, password)
                bug = bmo.get_bug('80000')
            except Exception, e:
                raise Exception('Failed to verify Bugzilla account on Bugzilla server:' + e)

            #generate salt, hash and store to db
            salt = os.urandom(8)
            m = hashlib.md5()
            m.update(salt)
            m.update(password)
            _hash = m.digest()
            user = User(email=email, _hash=_hash.encode('base64'), salt=salt.encode('base64'))
            db.session.add(user)
            db.session.commit()
            print 'creating'
            create_view(user, request)

            return loginSession(user, password)
    except Exception, e:
        print e
        if error is None:
            error = e
Beispiel #6
0
def nagEmailScript():
    print "*******In nagEmailScript"
    email_cc_list=['*****@*****.**']
    print "*******In nagEmailScript2"
    # Load our agent for BMO
    username = flask.session['username']
    print "*******In nagEmailScript", username
    password = flask.session['password']
    print "*******In nagEmailScript", password
    print "\n\nbefore bmo"
    bmo = BMOAgent(username, password)
    people = flask.session["people"]
    queries = flask.session['queries'] 
    print "\n\nafter BMO"
    # Get the buglist(s)
    collected_queries = {}
    print queries
    for query in queries:
    # import the query
        print "*****",query
        query_name = query['query_name']
        print "\nquery_name\n",query_name
        print "\nquery_channel\n",query['query_channel']
        collected_queries[query_name] = {
            'channel': query['query_channel'],
            'bugs' : [],
            }
        print "\n\nafter import query"
        if query.has_key('query_params'):
            print "Gathering bugs from query_params in %s" % query
            collected_queries[query_name]['bugs'] = bmo.get_bug_list(query['query_params'])
        elif query.has_key('query_url'):
            print "Gathering bugs from query_url in %s" % query
            collected_queries[query_name]['bugs'] = bmo.get_bug_list(query_url_to_dict(query['query_url'])) 
        else:
            raise Exception("Error - no valid query params or url in the config file")
            
    print "After collected queries",   collected_queries  
    total_bugs = 0
    for channel in collected_queries.keys():
        total_bugs += len(collected_queries[channel]['bugs'])

    print "Found %s bugs total for %s queries" % (total_bugs, len(collected_queries.keys()))
    print "Queries to collect: %s" % collected_queries.keys()
    managers = people.managers
    manual_notify = []
    counter = 0
    print "\najajajakakka"
    
    def add_to_managers(manager_email, query):
        if managers[manager_email].has_key('nagging'):
            if managers[manager_email]['nagging'].has_key(query):
                managers[manager_email]['nagging'][query]['bugs'].append(bug)
                print "Adding %s to %s in nagging for %s" % (bug.id, query, manager_email)
            else:
                managers[manager_email]['nagging'][query] = { 'bugs': [bug] }
                print "Adding new query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
        else:
            managers[manager_email]['nagging'] = {
                    query : { 'bugs': [bug] },
                }
            print "Creating query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
    
  
    verbose = False
    for query in collected_queries.keys():
        print "\nBNBNBNNBN\n"
        
        for b in collected_queries[query]['bugs']:
            if verbose:
                print "\nb::::",b
            counter = counter + 1
            send_mail = True
            bug = bmo.get_bug(b.id)
            if verbose:
                print "\nYYYYYYYYYYYYYYYYYYYYY210\n"
            manual_notify.append(bug)
            assignee = bug.assigned_to.name
            if people.people_by_bzmail.has_key(assignee):
                person = dict(people.people_by_bzmail[assignee])
            else:
                person = None
            if verbose:
                print "\nYYYYYYYYYYYYYYYYYYYYY217\n"
            if send_mail:
                if verbose:
                    print "\nYYYYYYYYYYYYYYYYYYYYY219\n"
                if 'nobody' in assignee:
                    assignee = None
                # TODO - get rid of this, SUCH A HACK!
                elif '*****@*****.**' in assignee:
                    print "No one assigned to JS bug: %s, adding to dmandelin's list..." % bug.id
                    add_to_managers('*****@*****.**', query)
                else:
                    if bug.assigned_to.real_name != None:
                        if person != None:
                            # check if assignee is already a manager, add to their own list
                            if managers.has_key(person['mozillaMail']):
                                add_to_managers(person['mozillaMail'], query)
                            # otherwise we search for the assignee's manager
                            else:
                                # check for manager key first, a few people don't have them
                                if person.has_key('manager') and person['manager'] != None:
                                    manager_email = person['manager']['dn'].split('mail=')[1].split(',')[0]
                                    if managers.has_key(manager_email):
                                        add_to_managers(manager_email, query)
                                    elif people.vices.has_key(manager_email):
                                        # we're already at the highest level we'll go
                                        if managers.has_key(assignee):
                                            add_to_managers(assignee, query)
                                        else:
                                            managers[person['mozillaMail']] = {}
                                            add_to_managers(person['mozillaMail'], query)
                                    else:
                                        # try to go up one level and see if we find a manager
                                        if people.people.has_key(manager_email):
                                            person = dict(people.people[manager_email])
                                            manager_email = person['manager']['dn'].split('mail=')[1].split(',')[0]
                                            if managers.has_key(manager_email):
                                                add_to_managers(manager_email, query)
                                        else:
                                            print "Manager could not be found: %s" % manager_email
                                else:
                                    print "%s's entry doesn't list a manager! Let's ask them to update phonebook." % person['name']
                                    
    flask.session['manual_notify'] = manual_notify
    flask.session['managers'] = managers
    flask.session["counter"] = counter
    flask.session['total_bugs'] = total_bugs
Beispiel #7
0
def nagEmailScript():
    print "*******In nagEmailScript"
    email_cc_list=['*****@*****.**']
    
    # Load our agent for BMO
    username = flask.session['username']
    password = flask.session['password']
    
    bmo = BMOAgent(username, password)
    bmo.check_login("https://bugzilla.mozilla.org/show_bug.cgi?id=12");
    people = phonebook.PhonebookDirectory(flask.session['username'],flask.session['password']);
    queries = flask.session['queries'] 
    
    # Get the buglist(s)
    collected_queries = {}
    
    for query in queries:
    # import the query
        query_name = query['query_name']
        print "\nquery_name\n",query_name
        print "\nquery_channel\n",query['query_channel']
        collected_queries[query_name] = {
            'channel': query['query_channel'],
            'bugs' : [],
            }
        print "\n\nafter import query"
        if query.has_key('query_params'):
            print "Gathering bugs from query_params in %s" % query
            collected_queries[query_name]['bugs'] = bmo.get_bug_list(query['query_params'])
        elif query.has_key('query_url'):
            print "Gathering bugs from query_url in %s" % query
            collected_queries[query_name]['bugs'] = bmo.get_bug_list(query_url_to_urlencoded(query['query_url']))
        else:
            raise Exception("Error - no valid query params or url in the config file")
            
    total_bugs = 0
    for channel in collected_queries.keys():
        total_bugs += len(collected_queries[channel]['bugs'])

    print "Found %s bugs total for %s queries" % (total_bugs, len(collected_queries.keys()))
    print "Queries to collect: %s" % collected_queries.keys()
    managers = people.managers
    manual_notify = []
    counter = 0
    
    def add_to_managers(manager_email, query):
        if managers.has_key(manager_email):
            if managers[manager_email].has_key('nagging'):
                if managers[manager_email]['nagging'].has_key(query):
                    managers[manager_email]['nagging'][query]['bugs'].append(bug)
                    print "Adding %s to %s in nagging for %s" % (bug.id, query, manager_email)
                else:
                    managers[manager_email]['nagging'][query] = { 'bugs': [bug] }
                    print "Adding new query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
            else:
                managers[manager_email]['nagging'] = {
                        query : { 'bugs': [bug] },
                    }
                print "Creating query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
        else :
            print "Email not found in phonebook: ", manager_email
            managers[manager_email] = {}
            add_to_managers(manager_email, query)
  
    verbose = False
    for query in collected_queries.keys():
        for b in collected_queries[query]['bugs']:
            if verbose:
                print "\nb::::",b
            counter = counter + 1
            send_mail = True
            bug = bmo.get_bug(b.id)
            if verbose:
                print "\nYYYYYYYYYYYYYYYYYYYYY210\n"
            manual_notify.append(bug)
            assignee = bug.assigned_to.name
            if people.people_by_bzmail.has_key(assignee):
                person = dict(people.people_by_bzmail[assignee])
            else:
                person = None
            if verbose:
                print "\nYYYYYYYYYYYYYYYYYYYYY217\n"
            if send_mail:
                if verbose:
                    print "\nYYYYYYYYYYYYYYYYYYYYY219\n"
                if 'nobody' in assignee:
                    #getting the list of owners externally from Andreas's dashboard 
                    owners_js = urllib2.urlopen("http://andreasgal.github.io/dashboard/owners.js").read(10000)
                    
                    #formatting that js file that declares a variable into a json-ish string
                    owners_js = owners_js.split('{')
                    owners_js = "{" + owners_js[1]
                    owners_js = owners_js.split(';')
                    owners_js = owners_js[0]

                    #get rid of comments in the json file, run until all comments are gone
                    while owners_js.find('//') > 0 or owners_js.find('/*') > 0 :
                        owners_js = re.sub('//.*?\n|/\*.*?\*/', '\n', owners_js, re.S)
                    
                    #removing bracketed 2nds
                    while owners_js.find('(') > 0 or owners_js.find(')') > 0 :
                        owners_js = re.sub('\s*?\(.*?\)\s*?', '', owners_js, re.S)
                    
                    #removing trailing comma
                    owners_js = re.sub('{', '', owners_js)
                    owners_js = re.sub('}', '', owners_js)
                    owners_js = owners_js.strip(' \t\n\r')
                    owners_js = owners_js.strip(',')
                    owners_js = '{\n' + owners_js + '\n}'
                    
                    #search for email of the responsible component owner
                    owners_js = simplejson.loads(owners_js)
                    if ( owners_js.has_key(bug.component) ):
                        component_manager_name = owners_js[bug.component]
                        if people.people_by_name.has_key(component_manager_name) :
                            component_manager = people.people_by_name[component_manager_name]
                            if component_manager['mozillaMail'] != None:
                                add_to_managers(component_manager['mozillaMail'], query)
                            else:
                                assignee = None
                        else :
                            print "Name not found in phonebook: ", component_manager_name 
                            assignee = None
                    else:
                        assignee = None

                # TODO - get rid of this, SUCH A HACK!
                elif '*****@*****.**' in assignee:
                    #dmandelin is no longer with the firm so this is changed yo naveed
                    #Note to self do perform error handling in add_to_managers
                    print "No one assigned to JS bug: %s, adding to dmandelin's list..." % bug.id
                    add_to_managers('*****@*****.**', query)
                else:
                    if bug.assigned_to.real_name != None:
                        if person != None:
                            # check if assignee is already a manager, add to their own list
                            if managers.has_key(person['mozillaMail']):
                                add_to_managers(person['mozillaMail'], query)
                            # otherwise we search for the assignee's manager
                            else:
                                # check for manager key first, a few people don't have them
                                if person.has_key('manager') and person['manager'] != None:
                                    manager_email = person['manager']['dn'].split('mail=')[1].split(',')[0]
                                    if managers.has_key(manager_email):
                                        add_to_managers(manager_email, query)
                                    elif people.vices.has_key(manager_email):
                                        # we're already at the highest level we'll go
                                        if managers.has_key(assignee):
                                            add_to_managers(assignee, query)
                                        else:
                                            managers[person['mozillaMail']] = {}
                                            add_to_managers(person['mozillaMail'], query)
                                    else:
                                        # try to go up one level and see if we find a manager
                                        if people.people.has_key(manager_email):
                                            person = dict(people.people[manager_email])
                                            manager_email = person['manager']['dn'].split('mail=')[1].split(',')[0]
                                            if managers.has_key(manager_email):
                                                add_to_managers(manager_email, query)
                                        else:
                                            print "Manager could not be found: %s" % manager_email
                                else:
                                    print "%s's entry doesn't list a manager! Let's ask them to update phonebook." % person['name']
    send_msg = []
    manual_notify_msg =''
    for email, info in managers.items():
        if info.has_key('nagging'):
            print "\n\nIn nagging"
            msg = generateEmailOutput(
            people,
            manager_email=email,
            queries=info['nagging'],
            template=flask.session['modified_template'],
            show_summary=True,
            show_comment=False)
            send_msg.append(msg)
            sent_bugs = 0
            for query, info in info['nagging'].items():
                sent_bugs += len(info['bugs'])
                # take sent bugs out of manual notification list
                for bug in info['bugs']:
                    manual_notify.remove(bug)
                counter = counter - sent_bugs
    
    
  # output the manual notification list
    manual_notify_msg += "No email generated for %s/%s bugs, you will need to manually notify the following %s bugs:\n\n" % (counter, total_bugs, len(manual_notify))
    url = "https://bugzilla.mozilla.org/buglist.cgi?quicksearch="
    
    for bug in manual_notify:
        manual_notify_msg += "[Bug %s] -- assigned to: %s -- Last commented on: %s\n" % (bug.id, bug.assigned_to.real_name, bug.comments[-1].creation_time.replace(tzinfo=None))
        url += "%s," % bug.id
    manual_notify_msg += "\n\nUrl for manual notification bug list: %s \n" % url
    #print send_msg
    return send_msg, manual_notify_msg


    
    
    if not managers:
        msg = "\n*************\nNo email generated for %s/%s bugs, you will need to manually notify the following %s bugs:\n" % (counter, flask.session['total_bugs'] , len(manual_notify))
        url = "https://bugzilla.mozilla.org/buglist.cgi?quicksearch="
    
        for bug in manual_notify:
            msg += "[Bug %s] -- assigned to: %s\n -- Last commented on: %s\n" % (bug.id, bug.assigned_to.real_name, bug.comments[-1].creation_time.replace(tzinfo=None))
            url += "%s," % bug.id
        msg += "Url for manual notification bug list: %s" % url
        return True, msg
 def test_get_bug(self):
     # Load our agent for BMO
     bmo = BMOAgent()
     # Get the bugs from the api
     bug = bmo.get_bug(656222)
     assert bug != []
Beispiel #9
0
         else:
             managers[manager_email]['nagging'][query] = { 'bugs': [bug] }
             if options.verbose:
                 print "Adding new query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
     else:
         managers[manager_email]['nagging'] = {
                 query : { 'bugs': [bug] },
             }
         if options.verbose:
             print "Creating query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
 
 for query in collected_queries.keys():
     for b in collected_queries[query]['bugs']:
         counter = counter + 1
         send_mail = True
         bug = bmo.get_bug(b.id)
         manual_notify.append(bug)
         assignee = bug.assigned_to.name
         if people.people_by_bzmail.has_key(assignee):
             person = dict(people.people_by_bzmail[assignee])
         else:
             person = None
         
         # kick bug out if days since comment check is on
         if options.days_since_comment != -1:
             # try to get last_comment by assignee & manager
             if person != None:
                 last_comment = get_last_assignee_comment(bug.comments, person)
                 if person.has_key('manager') and person['manager'] != None:
                     manager_email = person['manager']['dn'].split('mail=')[1].split(',')[0]
                     manager = people.people[manager_email]
 def test_get_bug(self):
     # Load our agent for BMO
     bmo = BMOAgent()
     # Get the bugs from the api
     bug = bmo.get_bug(656222)
     assert bug != []
Beispiel #11
0
def nagEmailScript():
    print "*******In nagEmailScript"
    email_cc_list=['*****@*****.**']
    print "*******In nagEmailScript2"
    # Load our agent for BMO
    username = flask.session['username']
    print "*******In nagEmailScript", username
    password = flask.session['password']
    print "*******In nagEmailScript", password
    print "\n\nbefore bmo"
    
    bmo = BMOAgent(username, password)
    bmo.check_login("https://bugzilla.mozilla.org/show_bug.cgi?id=12");
    #people = flask.session["people"]
    people = phonebook.PhonebookDirectory(flask.session['username'],flask.session['password']);
    queries = flask.session['queries'] 
    print "\n\nafter BMO"
    # Get the buglist(s)
    collected_queries = {}
    print queries
    for query in queries:
    # import the query
        print "*****",query
        query_name = query['query_name']
        print "\nquery_name\n",query_name
        print "\nquery_channel\n",query['query_channel']
        collected_queries[query_name] = {
            'channel': query['query_channel'],
            'bugs' : [],
            }
        print "\n\nafter import query"
        if query.has_key('query_params'):
            print "Gathering bugs from query_params in %s" % query
            collected_queries[query_name]['bugs'] = bmo.get_bug_list(query['query_params'])
        elif query.has_key('query_url'):
            print "Gathering bugs from query_url in %s" % query
            collected_queries[query_name]['bugs'] = bmo.get_bug_list(query_url_to_urlencoded(query['query_url']))
            print "gathered$$$$$$$$$$$"
        else:
            raise Exception("Error - no valid query params or url in the config file")
            
    print "After collected queries",   collected_queries  
    total_bugs = 0
    for channel in collected_queries.keys():
        total_bugs += len(collected_queries[channel]['bugs'])

    print "Found %s bugs total for %s queries" % (total_bugs, len(collected_queries.keys()))
    print "Queries to collect: %s" % collected_queries.keys()
    managers = people.managers
    manual_notify = []
    counter = 0
    print "\najajajakakka"
    
    def add_to_managers(manager_email, query):
        if managers[manager_email].has_key('nagging'):
            if managers[manager_email]['nagging'].has_key(query):
                managers[manager_email]['nagging'][query]['bugs'].append(bug)
                print "Adding %s to %s in nagging for %s" % (bug.id, query, manager_email)
            else:
                managers[manager_email]['nagging'][query] = { 'bugs': [bug] }
                print "Adding new query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
        else:
            managers[manager_email]['nagging'] = {
                    query : { 'bugs': [bug] },
                }
            print "Creating query key %s for bug %s in nagging and %s" % (query, bug.id, manager_email)
    
  
    verbose = False
    for query in collected_queries.keys():
        print "\nBNBNBNNBN\n"
        
        for b in collected_queries[query]['bugs']:
            if verbose:
                print "\nb::::",b
            counter = counter + 1
            send_mail = True
            bug = bmo.get_bug(b.id)
            if verbose:
                print "\nYYYYYYYYYYYYYYYYYYYYY210\n"
            manual_notify.append(bug)
            assignee = bug.assigned_to.name
            if people.people_by_bzmail.has_key(assignee):
                person = dict(people.people_by_bzmail[assignee])
            else:
                person = None
            if verbose:
                print "\nYYYYYYYYYYYYYYYYYYYYY217\n"
            if send_mail:
                if verbose:
                    print "\nYYYYYYYYYYYYYYYYYYYYY219\n"
                if 'nobody' in assignee:
                    assignee = None
                # TODO - get rid of this, SUCH A HACK!
                elif '*****@*****.**' in assignee:
                    #dmandelin is no longer with the firm so this is changed yo naveed
                    #Note to self do perform error handling in add_to_managers
                    print "No one assigned to JS bug: %s, adding to dmandelin's list..." % bug.id
                    add_to_managers('*****@*****.**', query)
                else:
                    if bug.assigned_to.real_name != None:
                        if person != None:
                            # check if assignee is already a manager, add to their own list
                            if managers.has_key(person['mozillaMail']):
                                add_to_managers(person['mozillaMail'], query)
                            # otherwise we search for the assignee's manager
                            else:
                                # check for manager key first, a few people don't have them
                                if person.has_key('manager') and person['manager'] != None:
                                    manager_email = person['manager']['dn'].split('mail=')[1].split(',')[0]
                                    if managers.has_key(manager_email):
                                        add_to_managers(manager_email, query)
                                    elif people.vices.has_key(manager_email):
                                        # we're already at the highest level we'll go
                                        if managers.has_key(assignee):
                                            add_to_managers(assignee, query)
                                        else:
                                            managers[person['mozillaMail']] = {}
                                            add_to_managers(person['mozillaMail'], query)
                                    else:
                                        # try to go up one level and see if we find a manager
                                        if people.people.has_key(manager_email):
                                            person = dict(people.people[manager_email])
                                            manager_email = person['manager']['dn'].split('mail=')[1].split(',')[0]
                                            if managers.has_key(manager_email):
                                                add_to_managers(manager_email, query)
                                        else:
                                            print "Manager could not be found: %s" % manager_email
                                else:
                                    print "%s's entry doesn't list a manager! Let's ask them to update phonebook." % person['name']
    send_msg = []
    manual_notify_msg =''
    for email, info in managers.items():
        if info.has_key('nagging'):
            print "\n\nIn nagging"
            msg = generateEmailOutput(
            people,
            manager_email=email,
            queries=info['nagging'],
            template=flask.session['modified_template'],
            show_summary=True,
            show_comment=False)
            send_msg.append(msg)
            sent_bugs = 0
            for query, info in info['nagging'].items():
                sent_bugs += len(info['bugs'])
                # take sent bugs out of manual notification list
                for bug in info['bugs']:
                    manual_notify.remove(bug)
                counter = counter - sent_bugs
    
    
  # output the manual notification list
    manual_notify_msg += "No email generated for %s/%s bugs, you will need to manually notify the following %s bugs:\n\n" % (counter, total_bugs, len(manual_notify))
    url = "https://bugzilla.mozilla.org/buglist.cgi?quicksearch="
    for bug in manual_notify:
        manual_notify_msg += "[Bug %s] -- assigned to: %s -- Last commented on: %s\n" % (bug.id, bug.assigned_to.real_name, bug.comments[-1].creation_time.replace(tzinfo=None))
        url += "%s," % bug.id
    manual_notify_msg += "\n\nUrl for manual notification bug list: %s \n" % url
    return send_msg, manual_notify_msg


    
    
    if not managers:
        msg = "\n*************\nNo email generated for %s/%s bugs, you will need to manually notify the following %s bugs:\n" % (counter, flask.session['total_bugs'] , len(manual_notify))
        url = "https://bugzilla.mozilla.org/buglist.cgi?quicksearch="
    
        for bug in manual_notify:
            msg += "[Bug %s] -- assigned to: %s\n -- Last commented on: %s\n" % (bug.id, bug.assigned_to.real_name, bug.comments[-1].creation_time.replace(tzinfo=None))
            url += "%s," % bug.id
        msg += "Url for manual notification bug list: %s" % url
        return True, msg