Skip to content

Commit

Permalink
remove rest of removed_project_access
Browse files Browse the repository at this point in the history
  • Loading branch information
harminius committed Jul 28, 2023
1 parent 80093ca commit 0f47510
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions server/mergin/sync/public_api_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from connexion import NoContent, request
from flask import (
abort,
render_template,
current_app,
send_from_directory,
jsonify,
Expand All @@ -35,7 +34,7 @@
from werkzeug.exceptions import HTTPException
from .. import db
from ..auth import auth_required
from ..auth.models import User, UserProfile
from ..auth.models import User
from .models import Project, ProjectAccess, ProjectVersion, Upload
from .schemas import (
ProjectSchema,
Expand Down Expand Up @@ -643,24 +642,6 @@ def update_project(namespace, project_name): # noqa: E501 # pylint: disable=W0
db.session.add(project)
db.session.commit()

# send email notifications about changes to users
user_profiles = UserProfile.query.filter(
UserProfile.user_id.in_(list(id_diffs))
).all()
project_path = "/".join([namespace, project.name])
web_link = f"{request.url_root.strip('/')}/projects/{project_path}"
for user_profile in user_profiles:
if not (
user_profile.receive_notifications and user_profile.user.verified_email
):
continue
privileges = []
if user_profile.user.id in project.access.owners:
privileges += ["edit", "remove"]
if user_profile.user.id in project.access.writers:
privileges.append("upload")
if user_profile.user.id in project.access.readers:
privileges.append("download")
# partial success
if error:
return jsonify(**error.to_dict(), project=ProjectSchema().dump(project)), 207
Expand Down

0 comments on commit 0f47510

Please sign in to comment.