Giter VIP home page Giter VIP logo

Comments (5)

brianmay avatar brianmay commented on August 12, 2024

Don't understand why there is a DeprecationWarning here, think the code will work just fine if you delete the error condition.

diff --git a/karaage/people/models.py b/karaage/people/models.py
index dfdd856..3f7f9bc 100644
--- a/karaage/people/models.py
+++ b/karaage/people/models.py
@@ -723,12 +723,6 @@ class Group(models.Model):
     sync_members.alters_data = True

     def add_person(self, person):
-        from karaage.projects.models import Project
-        ct = self.content_type
-        if ct and ct.model_class() is Project:
-            raise DeprecationWarning(
-                'Add project group members via ProjectMembership.',
-            )
         self.members.add(person)
     add_person.alters_data = True

from karaage.

brianmay avatar brianmay commented on August 12, 2024

On second thoughts this code really is broken.

I thought I saw code that synced changes from Group to ProjectMembership, but in actual fact it syncs in the opposite direction, ProjectMembership to Group. There is a TODO in the code to fix this:

TODO: Automatic update project membership using signals from Group.members, using defaults defined below.

If fixing this, need to make sure you don't create a loop with ProjectMembership notifying changes to Group and Group notifying changes to ProjectMembership.

Reopening.

from karaage.

tysonclugg avatar tysonclugg commented on August 12, 2024

Hi Brian,

Sounds like the TODO is broken. The pattern should be that POSIX groups are output from other sources such as ProjectMembership, and as such sync should always be from to Group.

Regards,
Tyson.

from karaage.

brianmay avatar brianmay commented on August 12, 2024

You mean "sync should always be from ProjectMembership to Group" right?

from karaage.

tysonclugg avatar tysonclugg commented on August 12, 2024

Indeed - sync should always be from ProjectMembership to Group. Rewording fail...

from karaage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.