|
|
@@ -153,9 +153,11 @@ def lensman_photo_upload_api(request):
|
153
|
153
|
|
154
|
154
|
# 用户状态校验
|
155
|
155
|
if lensman_type == UserInfo.COMMON: # 普通摄影师校验
|
|
156
|
+ watermark = True
|
156
|
157
|
if user.is_common_lensman and user.user_status != UserInfo.ACTIVATED:
|
157
|
158
|
return response(LensmanStatusCode.LENSMAN_NOT_ACTIVATED)
|
158
|
159
|
elif lensman_type == UserInfo.OUTTAKE: # 花絮摄影师校验
|
|
160
|
+ watermark = False
|
159
|
161
|
if user.is_outtake_lensman and user.outtake_status != UserInfo.ACTIVATED:
|
160
|
162
|
return response(LensmanStatusCode.LENSMAN_NOT_ACTIVATED)
|
161
|
163
|
|
|
|
@@ -175,7 +177,7 @@ def lensman_photo_upload_api(request):
|
175
|
177
|
group_id = group.group_id
|
176
|
178
|
|
177
|
179
|
if photo and upload_lock(group_id, user_id, photo):
|
178
|
|
- photo_info = file_save(photo, prefix='photo', ext='.jpeg', watermark=True, thumbnail=True)
|
|
180
|
+ photo_info = file_save(photo, prefix='photo', ext='.jpeg', watermark=watermark, thumbnail=True)
|
179
|
181
|
|
180
|
182
|
# 写 PhotosInfo 表
|
181
|
183
|
photo, created = PhotosInfo.objects.get_or_create(
|
|
|
@@ -200,8 +202,8 @@ def lensman_photo_upload_api(request):
|
200
|
202
|
defaults={
|
201
|
203
|
'nickname': user.final_nickname,
|
202
|
204
|
'avatar': user.avatar,
|
203
|
|
- 'photo_path': photo_info.photo_watermark_path,
|
204
|
|
- 'has_watermark': True,
|
|
205
|
+ 'photo_path': photo_info.photo_watermark_path if watermark else photo_info.photo_path,
|
|
206
|
+ 'has_watermark': watermark,
|
205
|
207
|
'photo_w': photo_info.photo_w,
|
206
|
208
|
'photo_h': photo_info.photo_h,
|
207
|
209
|
'photo_thumbnail_path': photo_info.photo_thumbnail_path,
|