Skip to content

Commit 73e29cb

Browse files
committed
Increase profile gallery photo limits
Bump the cap from 1 to 2 photos for non-verified users and from 4 to 5 for strongly-verified users.
1 parent e1d2123 commit 73e29cb

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/backend/src/couchers/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
DONATION_OFFSET_USD = 2000
113113

114114
# Photo gallery limits
115-
GALLERY_MAX_PHOTOS_NOT_VERIFIED = 1
116-
GALLERY_MAX_PHOTOS_VERIFIED = 4
115+
GALLERY_MAX_PHOTOS_NOT_VERIFIED = 2
116+
GALLERY_MAX_PHOTOS_VERIFIED = 5
117117

118118
COMPLETED_PROFILE_MINIMUM_CHAR_LENGTH = 150
119119

app/backend/src/tests/test_galleries.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_GetGalleryEditInfo(db):
4646
with galleries_session(token1) as api:
4747
res = api.GetGalleryEditInfo(galleries_pb2.GetGalleryEditInfoReq(gallery_id=user1.profile_gallery_id))
4848
assert res.gallery_id == user1.profile_gallery_id
49-
assert res.max_photos == 1
49+
assert res.max_photos == 2
5050
assert res.current_photo_count == 0
5151

5252

@@ -56,7 +56,7 @@ def test_GetGalleryEditInfo_verified_user(db):
5656
with galleries_session(token1) as api:
5757
res = api.GetGalleryEditInfo(galleries_pb2.GetGalleryEditInfoReq(gallery_id=user1.profile_gallery_id))
5858
assert res.gallery_id == user1.profile_gallery_id
59-
assert res.max_photos == 4
59+
assert res.max_photos == 5
6060
assert res.current_photo_count == 0
6161

6262

@@ -94,7 +94,7 @@ def test_GetGalleryEditInfo_with_photos(db):
9494
)
9595

9696
res = api.GetGalleryEditInfo(galleries_pb2.GetGalleryEditInfoReq(gallery_id=user1.profile_gallery_id))
97-
assert res.max_photos == 4
97+
assert res.max_photos == 5
9898
assert res.current_photo_count == 3
9999

100100

@@ -236,10 +236,10 @@ def test_AddPhotoToGallery_max_capacity(db):
236236
user1, token1 = generate_user(complete_profile=False, strong_verification=True)
237237

238238
with session_scope() as session:
239-
keys = [create_upload(session, user1.id, f"photo{i}.jpg") for i in range(5)]
239+
keys = [create_upload(session, user1.id, f"photo{i}.jpg") for i in range(6)]
240240

241241
with galleries_session(token1) as api:
242-
for i in range(4):
242+
for i in range(5):
243243
api.AddPhotoToGallery(
244244
galleries_pb2.AddPhotoToGalleryReq(
245245
gallery_id=user1.profile_gallery_id,
@@ -251,7 +251,7 @@ def test_AddPhotoToGallery_max_capacity(db):
251251
api.AddPhotoToGallery(
252252
galleries_pb2.AddPhotoToGalleryReq(
253253
gallery_id=user1.profile_gallery_id,
254-
upload_key=keys[4],
254+
upload_key=keys[5],
255255
)
256256
)
257257
assert e.value.code() == grpc.StatusCode.FAILED_PRECONDITION

0 commit comments

Comments
 (0)