Python NameError: global name 'resolution' is not defined

76

Make the following changes to your script:

Below line def ResComboB_changed(ResComboB): add the following to it, so it looks like this:

def ResComboB_changed(ResComboB):
    global resolution

or add resolution = "" above the def line like this:

resolution = ""
def ResComboB_changed(ResComboB):

Hope that helps ;)

Share:
76

Related videos on Youtube

Cazforshort
Author by

Cazforshort

Updated on September 18, 2022

Comments

  • Cazforshort
    Cazforshort over 1 year

    I cant seem to get certain records to modify in my public database. The error is

    Error saving record <CKRecordID: XXXXXXX; recordName=XXXXXX, zoneID=_defaultZone:defaultOwner> to server: WRITE operation not permitted

    I don't understand why it says "Write not permitted" because I have all the correct Security Roles checked off in the dashboard. I also confirmed that it is signed into Icloud before I try to modify the record.

    This is the relevant code:

    // MARK: - Modify Updates in Cloudkit
    static func modifyUpdates(item: pushNote, completion: @escaping (Result<pushNote, Error>) ->
        ()) {
        guard let recordID = item.recordID else { return }
        CKContainer.default().publicCloudDatabase.fetch(withRecordID: recordID) { (record, err) in
            DispatchQueue.main.async {
                if let err = err {
                    completion(.failure(err))
                    return
                }
                guard let record = record else { return }
                
                
                record["updates"] = item.updates as CKRecordValue
                
                CKContainer.default().publicCloudDatabase.save(record) { (record, err) in
                    DispatchQueue.main.async {
                        if let err = err {
                            completion(.failure(err))
                            return
                        }
                        guard let record = record else { return }
                        let id = record.recordID
                        guard let updts = record["updates"] as? [String] else { return }
                        guard let boss = record["bossID"] as? String else { return }
                        
                        let element = pushNote(recordID:id, bossID: boss, updates : updts)
                        completion(.success(element))
                    }
                }
            }
        }
    }
    
  • TellMeWhy
    TellMeWhy about 8 years
    Isn't using global parameters bad practice though?