예제 #1
0
 def get_context(self, request, *args, **kwargs):
     room = models.Room.objects.create(
         name=request.params.name,
         description=request.params.description,
         create_user_id=request.user.pk,
         create_user_manager=request.params.create_user_manager
     )
     try:
         room.qr_code = biz.get_wxa_code_unlimited_file(
             "room_%d.jpg" % room.pk, scene="room_id=%d" % room.pk, page="pages/room/detail"
         )
         room.save(update_fields=['qr_code', ], force_update=True)
     except Exception:
         utility.reportExceptionByMail("get_wxa_code_unlimited_file")
     self.get_room_follow(room.pk, request.user.pk)
     return serializer.RoomSerializer(room, request=request).data
예제 #2
0
 def get_context(self, request, *args, **kwargs):
     room = models.Room.objects.create(
         name=request.params.name,
         description=request.params.description,
         create_user_id=request.user.pk,
         create_user_manager=request.params.create_user_manager)
     try:
         room.qr_code = biz.get_wxa_code_unlimited_file(
             "room_%d.jpg" % room.pk,
             scene="room_id=%d" % room.pk,
             page="pages/room/detail")
         room.save(update_fields=[
             'qr_code',
         ], force_update=True)
     except Exception:
         utils.exception_logging.exception("get_wxa_code_unlimited_file",
                                           extra={'request': request})
     self.get_room_follow(room.pk, request.user.pk)
     return room