glizzan / concord

Other
1 stars 1 forks source link

Filter Conditions + misc #144

Closed shaunagm closed 3 years ago

shaunagm commented 3 years ago

This is mostly creating filter conditions & attendant migrations, but there's also a bit of clean up involved, particularly the removal of the resource & item model + state changes.

shaunagm commented 3 years ago

Note - I missed a step when removing the Item/Resource state changes. In addition to removing those permissions in the database, we also need to remove actions taken through those permissions. There was only one I could find, removed via this command:

from django.db import connection

def my_custom_sql():
    with connection.cursor() as cursor:
        command = "DELETE FROM actions_action WHERE LOWER(change) LIKE 'removeitemstatechange';"
        cursor.execute(command)
        row = cursor.fetchone()

    return row