-9 ol-9"> 171
+        current_id=group_photo and group_photo.id or -1,
169 172
         nickname=nickname or user.username,
170 173
         admin=False,
171 174
         user_status=GroupUserInfo.PASSED,
@@ -398,6 +401,14 @@ def flyimg_upload_api(request):
398 401
             'message': u'群组不存在',
399 402
         })
400 403
 
404
+    try:
405
+        group_user = GroupUserInfo.objects.get(group_id=group_id, user_id=user_id, user_status=GroupUserInfo.PASSED)
406
+    except GroupUserInfo.DoesNotExist:
407
+        return JsonResponse({
408
+            'status': 4029,
409
+            'message': u'该用户不在群组',
410
+        })
411
+
401 412
     if photo:
402 413
         _, extension = os.path.splitext(photo.name)
403 414
 
@@ -423,7 +434,7 @@ def flyimg_upload_api(request):
423 434
 
424 435
     group_photos = GroupPhotoInfo.objects.filter(
425 436
         group_id=group_id,
426
-        pk__gt=current_id,
437
+        pk__gt=max(current_id, group_user.current_id),
427 438
     )
428 439
     latest_photo = group_photos.last()
429 440
 

+ 1 - 1
pai2/settings.py

@@ -104,7 +104,7 @@ DATABASES = {
104 104
 # Internationalization
105 105
 # https://docs.djangoproject.com/en/1.8/topics/i18n/
106 106
 
107
-LANGUAGE_CODE = 'zh_CN'
107
+LANGUAGE_CODE = 'zh-Hans'
108 108
 
109 109
 TIME_ZONE = 'Asia/Shanghai'
110 110
 

kodo - Gogs: Go Git Service

No Description

0045_auto_20180930_1159.py 777B

    # -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-30 03:59 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('group', '0044_auto_20180103_0446'), ] operations = [ migrations.AlterField( model_name='groupinfo', name='phone', field=models.CharField(blank=True, help_text='\u5bfc\u6e38\u7535\u8bdd', max_length=11, null=True, verbose_name='phone'), ), migrations.AlterField( model_name='groupuserinfo', name='phone', field=models.CharField(blank=True, help_text='\u7528\u6237\u7535\u8bdd', max_length=11, null=True, verbose_name='phone'), ), ]