@@ -37,7 +37,7 @@ def read_galleries(
3737 project = crud .get_project (session = session , project_id = project_id )
3838 if not project :
3939 raise HTTPException (status_code = 404 , detail = "Project not found" )
40-
40+
4141 # Check access based on user type
4242 if user_type == "client" :
4343 # Client must have explicit access
@@ -62,15 +62,15 @@ def read_galleries(
6262 session = session , user_id = current_user .id , skip = 0 , limit = 1000
6363 )
6464 project_ids = [p .id for p in accessible_projects ]
65-
65+
6666 # Get galleries for all accessible projects
6767 galleries = []
6868 for pid in project_ids [skip :skip + limit ]:
6969 project_galleries = crud .get_galleries_by_project (
7070 session = session , project_id = pid , skip = 0 , limit = 100
7171 )
7272 galleries .extend (project_galleries )
73-
73+
7474 count = sum (
7575 len (crud .get_galleries_by_project (session = session , project_id = pid , skip = 0 , limit = 1000 ))
7676 for pid in project_ids
@@ -81,7 +81,7 @@ def read_galleries(
8181 raise HTTPException (
8282 status_code = 400 , detail = "User is not part of an organization"
8383 )
84-
84+
8585 galleries = crud .get_galleries_by_organization (
8686 session = session ,
8787 organization_id = current_user .organization_id ,
@@ -103,13 +103,13 @@ def create_gallery(
103103 Create new gallery. Only team members can create galleries.
104104 """
105105 user_type = getattr (current_user , "user_type" , None )
106-
106+
107107 # Only team members can create galleries
108108 if user_type != "team_member" :
109109 raise HTTPException (
110110 status_code = 403 , detail = "Only team members can create galleries"
111111 )
112-
112+
113113 if not current_user .organization_id :
114114 raise HTTPException (
115115 status_code = 400 , detail = "User is not part of an organization"
@@ -138,7 +138,7 @@ def read_gallery(session: SessionDep, current_user: CurrentUser, id: uuid.UUID)
138138 project = crud .get_project (session = session , project_id = gallery .project_id )
139139 if not project :
140140 raise HTTPException (status_code = 404 , detail = "Project not found" )
141-
141+
142142 if user_type == "client" :
143143 # Client must have access to the project
144144 if not crud .user_has_project_access (
@@ -165,13 +165,13 @@ def update_gallery(
165165 Update a gallery. Only team members can update galleries.
166166 """
167167 user_type = getattr (current_user , "user_type" , None )
168-
168+
169169 # Only team members can update galleries
170170 if user_type != "team_member" :
171171 raise HTTPException (
172172 status_code = 403 , detail = "Only team members can update galleries"
173173 )
174-
174+
175175 gallery = crud .get_gallery (session = session , gallery_id = id )
176176 if not gallery :
177177 raise HTTPException (status_code = 404 , detail = "Gallery not found" )
@@ -195,13 +195,13 @@ def delete_gallery(
195195 Delete a gallery. Only team members can delete galleries.
196196 """
197197 user_type = getattr (current_user , "user_type" , None )
198-
198+
199199 # Only team members can delete galleries
200200 if user_type != "team_member" :
201201 raise HTTPException (
202202 status_code = 403 , detail = "Only team members can delete galleries"
203203 )
204-
204+
205205 gallery = crud .get_gallery (session = session , gallery_id = id )
206206 if not gallery :
207207 raise HTTPException (status_code = 404 , detail = "Gallery not found" )
0 commit comments