Browse Source

Remove the Member.rw field (superseded by Member.role)

pull/545/head
Pēteris Caune 3 years ago
parent
commit
cb799dbd29
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
2 changed files with 1 additions and 4 deletions
  1. +1
    -2
      hc/accounts/models.py
  2. +0
    -2
      hc/accounts/tests/test_project.py

+ 1
- 2
hc/accounts/models.py View File

@ -359,7 +359,7 @@ class Project(models.Model):
return False
role = Member.Role.REGULAR if rw else Member.Role.READONLY
Member.objects.create(user=user, project=self, rw=rw, role=role)
Member.objects.create(user=user, project=self, role=role)
checks_url = reverse("hc-checks", args=[self.code])
user.profile.send_instant_login_link(self, redirect_url=checks_url)
return True
@ -427,7 +427,6 @@ class Member(models.Model):
user = models.ForeignKey(User, models.CASCADE, related_name="memberships")
project = models.ForeignKey(Project, models.CASCADE)
transfer_request_date = models.DateTimeField(null=True, blank=True)
rw = models.BooleanField(default=True, null=True)
role = models.CharField(max_length=1, default=Role.REGULAR, choices=Role.choices)
class Meta:


+ 0
- 2
hc/accounts/tests/test_project.py View File

@ -78,7 +78,6 @@ class ProjectTestCase(BaseTestCase):
)
# The read-write flag should be set
self.assertTrue(member.rw)
self.assertEqual(member.role, member.Role.REGULAR)
# The new user should not have their own project
@ -99,7 +98,6 @@ class ProjectTestCase(BaseTestCase):
project=self.project, user__email="[email protected]"
)
self.assertFalse(member.rw)
self.assertEqual(member.role, member.Role.READONLY)
def test_it_adds_member_from_another_team(self):


Loading…
Cancel
Save