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

Before Change


                  }
        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",

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: 3

Non-data size: 5

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: sahana/eden
Commit Name: 2e268c86eee6a1753d16afe23388c9f26dd0f7ca
Time: 2020-01-27
Author: fran@aidiq.com
File Name: modules/s3db/setup.py
Class Name:
Method Name: setup_monitor_run_task


Project Name: ncoudray/DeepPATH
Commit Name: 64c0ea557df21a7585f6fd0fef9d1b0c20f2da3d
Time: 2019-11-19
Author: coudrn01@bigpurple-ln2.cm.cluster
File Name: DeepPATH_code/00_preprocessing/0b_tileLoop_deepzoom4.py
Class Name:
Method Name: