Skip to content

Commit

Permalink
Merge pull request #1669 from Bidaya0/feat/add_m2m_field_in_models
Browse files Browse the repository at this point in the history
feat: add m2m fields.
  • Loading branch information
Bidaya0 authored Jul 27, 2023
2 parents 7e3d022 + f27a146 commit 61718ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dongtai_common/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class IastProject(models.Model):
log_level = models.CharField(max_length=511, null=True, blank=True)
last_has_online_agent_time = models.IntegerField(default=get_timestamp)
status = models.IntegerField(default=0, choices=ProjectStatus.choices)
projectgroups = models.ManyToManyField("IastProjectGroup", through="IastProjectGroupProject")
users = models.ManyToManyField("User", through="IastProjectUser")

class Meta:
managed = get_managed()
Expand Down
2 changes: 1 addition & 1 deletion dongtai_common/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ def get_projects(self) -> QuerySet:
queryset = IastProject.objects.none()
if self.is_system_admin:
return IastProject.objects.all()
return patch_point(queryset)
return patch_point(self, queryset)

0 comments on commit 61718ad

Please sign in to comment.