824050634fda65bc39e977c23faa6112aa820bd3,modules/templates/CCC/controllers.py,,auth_user_register_onaccept,#Any#,1446

Before Change


                  "value": custom["mobile2"],
                  "realm_entity": realm_entity,
                  }
        ctable.insert(**record)
        home_phone = custom["home2"]
        if home_phone:
            record = {"pe_id": pe_id,
                      "contact_method": "HOME_PHONE",

After Change


                        email = custom["email2"],
                        password = custom["password2"],
                        )
        try:
            user_id = db.auth_user.insert(**user2)
        except:
            import sys
            error = sys.exc_info()[1]
            current.log.error = "Unable to add 2nd Leader to database: %s" % error
        else:
            user2.id = user_id
            // Approve User (Creates Person & Email)
            auth.s3_approve_user(user2)

            pe_id = auth.s3_user_pe_id(user_id)

            // Add Address
            record = {"addr_street": custom["addr_street2"],
                      "addr_postcode": custom["addr_postcode2"],
                      }
            location_id = gtable.insert(**record)
            record["id"] = location_id
            if callable(location_onaccept):
                gform = Storage(vars = record)
                location_onaccept(gform)

            record = {"pe_id": pe_id,
                      "location_id": location_id,
                      "realm_entity": realm_entity,
                      }
            address_id = atable.insert(**record)
            record["id"] = address_id
            if callable(address_onaccept):
                aform = Storage(vars = record)
                address_onaccept(aform)

            // Add Contacts
            ctable = s3db.pr_contact
            // Currently no need to onaccept as none defined
            record = {"pe_id": pe_id,
                      "contact_method": "SMS",
                      "value": custom["mobile2"],
                      "realm_entity": realm_entity,
                      }
            ctable.insert(**record)
            home_phone = custom["home2"]
            if home_phone:
                record = {"pe_id": pe_id,
                          "contact_method": "HOME_PHONE",
                          "value": home_phone,
                          "realm_entity": realm_entity,
                          }
                ctable.insert(**record)

            // Add Leader to Group
            person = db(ptable.pe_id == pe_id).select(ptable.id,
                                                      limitby = (0, 1),
                                                      ).first()
            record = {"group_id": group_id,
                      "person_id": person.id,
                      "group_head": True,
                      }
            membership_id = mtable.insert(**record)
            record["id"] = membership_id
            if callable(membership_onaccept):
                mform = Storage(vars = record)
                membership_onaccept(mform)

            // Assign correct Role
            auth.add_membership(user_id = user_id,
                                role = "Volunteer Group Leader",
                                entity = realm_entity,
                                )

        // Create Group Skills
        ctable = s3db.pr_group_competency
        for skill_id in custom["skill_id"]:
            record = {"group_id": group_id,
                      "skill_id": skill_id,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: sahana/eden
Commit Name: 824050634fda65bc39e977c23faa6112aa820bd3
Time: 2020-03-20
Author: fran@aidiq.com
File Name: modules/templates/CCC/controllers.py
Class Name:
Method Name: auth_user_register_onaccept


Project Name: cornellius-gp/gpytorch
Commit Name: d71bc3c8b533c319e49cf6b347d13c48c925ea93
Time: 2019-03-18
Author: gpleiss@gmail.com
File Name: gpytorch/utils/getitem.py
Class Name:
Method Name: _compute_getitem_size


Project Name: pandas-dev/pandas
Commit Name: 9cc905307df8c0b6ab74b911bb0dfa3e255161fd
Time: 2021-03-14
Author: jbrockmendel@gmail.com
File Name: pandas/core/indexes/interval.py
Class Name: IntervalIndex
Method Name: insert


Project Name: cmu-db/ottertune
Commit Name: 642d7c38757d1a1c76585253c7d02e8e45c8cccc
Time: 2019-12-10
Author: dongshen@andrew.cmu.edu
File Name: server/website/website/tasks/async_tasks.py
Class Name:
Method Name: clean_knob_data