fix(access): dont use organization property within organization model
ref: #605 #607
This commit is contained in:
@ -67,12 +67,6 @@ class Organization(SaveHistory):
|
||||
modified = AutoLastModifiedField()
|
||||
|
||||
|
||||
@property
|
||||
def organization(self):
|
||||
|
||||
return self
|
||||
|
||||
|
||||
def get_organization(self):
|
||||
return self
|
||||
|
||||
|
@ -157,12 +157,19 @@ class SaveHistory(models.Model):
|
||||
current_user = None
|
||||
|
||||
|
||||
organization = getattr(self, 'organization', None)
|
||||
|
||||
if self._meta.model_name == 'organization':
|
||||
|
||||
organization = self
|
||||
|
||||
|
||||
if before_json != after_json:
|
||||
|
||||
if parent_model is not None:
|
||||
|
||||
entry = history_model.objects.create(
|
||||
organization = self.organization,
|
||||
organization = organization,
|
||||
before = before_json,
|
||||
after = after_json,
|
||||
action = action,
|
||||
@ -180,7 +187,7 @@ class SaveHistory(models.Model):
|
||||
else:
|
||||
|
||||
entry = history_model.objects.create(
|
||||
organization = self.organization,
|
||||
organization = organization,
|
||||
before = before_json,
|
||||
after = after_json,
|
||||
action = action,
|
||||
|
Reference in New Issue
Block a user