Skip to content

Commit

Permalink
Try/except block when checking for editor tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
ethoms-usgs committed Jul 6, 2021
1 parent 8506901 commit a581010
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Scripts/GeMS_ValidateDatabase_AGP2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# 2/26/21: added copy.deepcopy to checkFieldDefinitions when building requiredFieldDefs
# 7/6/2: changed functions notEmpty and empty to evaluate str(x) instead of just x so that we could look for value of x.strip() when x is an integer.
# Will converting x to string ever return an unexpected value? - ET
# : added try/except block when checking for editor tracking because there's a chance the method didn't exist for pre 2.6 versions of AGPro - ET

import arcpy, os, os.path, sys, time, glob
import copy
Expand Down Expand Up @@ -628,8 +629,13 @@ def scanTable(table, fds=None):
isExtension = True
schemaExtensions.append(dsc.dataType+' <span class="table">'+table+'</span>')
### check for edit tracking
if dsc.editorTrackingEnabled:
otherWarnings.append('Editor tracking is enabled on <span class="table">'+table+'</span>')
try:
if dsc.editorTrackingEnabled:
otherWarnings.append('Editor tracking is enabled on <span class="table">'+table+'</span>')
except:
warn_text = f'''Cannot determine if Editor Tracking is enabled on <span class="table">'{table}'</span>' or not;
probably due to an older version of ArcGIS Pro being used. Check for this manually.'''
otherWarnings.append(warn_text)
### assign fields to categories:
fields = arcpy.ListFields(table)
fieldNames = fieldNameList(table)
Expand Down

0 comments on commit a581010

Please sign in to comment.