def join_invited_groups(self): """ Add this user as a member of any group for which there is an outstanding invitation. """ from sefaria.model import GroupSet groups = GroupSet({"invitations.email": self.email}) for group in groups: group.add_member(self.id) group.remove_invitation(self.email)
# -*- coding: utf-8 -*- import django django.setup() from sefaria.model import Group, GroupSet from sefaria.system.database import db # Add Sheet IDs to Collections GroupSet().update({"sheets": []}) sheets = db.sheets.find( {"$and": [{ "group": { "$exists": 1 } }, { "group": { "$nin": ["", None] } }]}) for sheet in sheets: group = Group().load({"name": sheet["group"]}) groop.sheets.append(sheet["id"]) group.save() # Turn "publishers" into "members" # Update sheet "group" field to "highlightedCollection"