Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

fix auditlog refs #479

Merged
merged 1 commit into from
May 9, 2022
Merged

fix auditlog refs #479

merged 1 commit into from
May 9, 2022

Conversation

seanpreston
Copy link
Contributor

@seanpreston seanpreston commented May 9, 2022

IPython 8.3.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from fidesops.db.session import get_db_session
In [2]: from fidesops.models.privacy_request import PrivacyRequest
In [3]: db = get_db_session()()
In [4]: PrivacyRequest.all(db)

The above results in the following error:

NameError: name 'AuditLog' is not defined
...
InvalidRequestError: When initializing mapper mapped class PrivacyRequest->privacyrequest, expression 'foreign(AuditLog.privacy_request_id)==PrivacyRequest.id' failed to locate a name ("name 'AuditLog' is not defined"). If this is a class name, consider adding this relationship() to the <class 'fidesops.models.privacy_request.PrivacyRequest'> class after both dependent classes have been defined.

because we're referring to AuditLog on the PrivacyRequest model via "AuditLog", which requires the class to be present in local scope, instead of using the imported class.

This PR also adds FidesopsUser.audit_logs to link FidesopsUser instances in the same way as PrivacyRequests.

@TheAndrewJackson TheAndrewJackson merged commit 9511852 into main May 9, 2022
@TheAndrewJackson TheAndrewJackson deleted the hotfix-audit-log-refs branch May 9, 2022 19:37
adamsachs pushed a commit to adamsachs/fidesops_forked_test that referenced this pull request May 17, 2022
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants