pre-commit is passing w/ burnettk
This commit is contained in:
parent
a97605b08b
commit
715395335f
|
@ -1,4 +1,4 @@
|
|||
"""group."""
|
||||
"""Group."""
|
||||
from flask_bpmn.models.db import db
|
||||
from flask_bpmn.models.group import FlaskBpmnGroupModel
|
||||
from sqlalchemy.orm import relationship
|
||||
|
@ -10,7 +10,10 @@ class GroupModel(FlaskBpmnGroupModel):
|
|||
__tablename__ = "group"
|
||||
__table_args__ = {"extend_existing": True}
|
||||
new_name_two = db.Column(db.String(255))
|
||||
user_group_assignments = relationship(
|
||||
"UserGroupAssignmentModel", cascade="delete"
|
||||
user_group_assignments = relationship("UserGroupAssignmentModel", cascade="delete")
|
||||
users = relationship(
|
||||
"UserModel",
|
||||
viewonly=True,
|
||||
secondary="user_group_assignment",
|
||||
overlaps="user_group_assignments,users",
|
||||
)
|
||||
users = relationship("UserModel", viewonly=True, secondary="user_group_assignment", overlaps="user_group_assignments,users")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""process_model."""
|
||||
"""Process_model."""
|
||||
from flask_bpmn.models.db import db
|
||||
from sqlalchemy.orm import deferred
|
||||
|
||||
|
|
|
@ -11,7 +11,10 @@ class UserModel(db.Model):
|
|||
username = db.Column(db.String(50), nullable=False, unique=True)
|
||||
name = db.Column(db.String(50))
|
||||
email = db.Column(db.String(50))
|
||||
user_group_assignments = relationship(
|
||||
"UserGroupAssignmentModel", cascade="delete"
|
||||
user_group_assignments = relationship("UserGroupAssignmentModel", cascade="delete")
|
||||
groups = relationship(
|
||||
"GroupModel",
|
||||
viewonly=True,
|
||||
secondary="user_group_assignment",
|
||||
overlaps="user_group_assignments,users",
|
||||
)
|
||||
groups = relationship("GroupModel", viewonly=True, secondary="user_group_assignment", overlaps="user_group_assignments,users")
|
||||
|
|
|
@ -156,6 +156,7 @@ def remove_user_from_group():
|
|||
|
||||
|
||||
def get_user_from_request():
|
||||
"""Get_user_from_request."""
|
||||
user_id = request.json.get("user_id")
|
||||
|
||||
if user_id is None:
|
||||
|
@ -174,6 +175,7 @@ def get_user_from_request():
|
|||
|
||||
|
||||
def get_group_from_request():
|
||||
"""Get_group_from_request."""
|
||||
group_id = request.json.get("group_id")
|
||||
|
||||
if group_id is None:
|
||||
|
|
|
@ -94,15 +94,15 @@ def test_user_can_be_removed_from_a_group(client):
|
|||
|
||||
def test_acceptance(client):
|
||||
# Create a user U
|
||||
user = create_user(client, 'U')
|
||||
user = create_user(client, "U")
|
||||
# Create a group G
|
||||
group_g = create_group(client, 'G')
|
||||
group_g = create_group(client, "G")
|
||||
# Assign user U to group G
|
||||
assign_user_to_group(client, user, group_g)
|
||||
# Delete group G
|
||||
delete_group(client, group_g.name)
|
||||
# Create group H
|
||||
group_h = create_group(client, 'H')
|
||||
group_h = create_group(client, "H")
|
||||
# Assign user U to group H
|
||||
assign_user_to_group(client, user, group_h)
|
||||
# Unassign user U from group H
|
||||
|
|
Loading…
Reference in New Issue