瀏覽代碼

add: convert webservice name to lowercase for the ejabber room names

System Administrator 1 年之前
父節點
當前提交
dca6f3efba
共有 2 個文件被更改,包括 2 次插入5 次删除
  1. 1 0
      ejabber.py
  2. 1 5
      serializer/orders.py

+ 1 - 0
ejabber.py

@@ -20,6 +20,7 @@ def get_rooms(service, order_num, support, client, provider):
     Create names and member list for each room.
     Returns a dict {room_name: ("member1", "member2", ...)}
     """
+    service = service.lower()
     # Set room names
     room_name1 = "_".join(str(attr) for attr in (service, order_num, client, support))
     room_name2 = "_".join(str(attr) for attr in (service, order_num, client, "with", provider))

+ 1 - 5
serializer/orders.py

@@ -15,8 +15,7 @@ class OrdersSerializer(serializers.ModelSerializer):
     
     def create(self, validated_data):
         ModelClass = self.Meta.model
-
-
+        
         
         if "ticket" not in validated_data:
             # Create ticket with minimal required data
@@ -107,9 +106,6 @@ class OrdersSerializer(serializers.ModelSerializer):
                     "jid": WEBSERVICE_NAME + "_backend@" + EJ_HOST,
                     "affiliation": "owner"
                 }
-                #
-                # REQUIRES TO BE TESTED, RESULTS OF THIS WERE NOT CONFIRMED TO BE CORRECT
-                #
                 # Add all neccessary member to the room
                 for member in room_members:
                     data["jid"] = members_accounts[member][0]