So that you don't have to specify the default twice, and to avoid the error if pk is not the id of an existing ClassCategory, you can re-write this function as something like:
```python
cc = None
if pk is not None:
    try:
        pk = int(pk)
        cc = ClassCategories.objects.get(pk=pk)
    except:
        pass
if cc is None:
    cc = ClassCategories.objects.get_or_create(category="Walk-in Activity", symbol='W', seq=0)[0]
return cc
```