Die falsche Subdomain-Zuordnung wurde behoben.
This commit is contained in:
+21
-12
@@ -1672,14 +1672,16 @@ def _get_instance_for_user(username, display_name=None, user_id=None):
|
||||
user_id = user_id or session.get("user_id")
|
||||
client, col = _get_collection("instances")
|
||||
try:
|
||||
query = {
|
||||
"$or": [
|
||||
{"owner_username": username},
|
||||
{"username": username},
|
||||
{"owner_id": user_id}
|
||||
]
|
||||
}
|
||||
return col.find_one(query)
|
||||
ownership_filters = [
|
||||
{"owner_username": username},
|
||||
{"username": username},
|
||||
]
|
||||
# A missing session user_id must not become {"owner_id": None}: in
|
||||
# MongoDB that also matches legacy documents without an owner_id.
|
||||
if user_id:
|
||||
ownership_filters.append({"owner_id": user_id})
|
||||
|
||||
return col.find_one({"$or": ownership_filters})
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
@@ -3828,10 +3830,17 @@ def my_instance_management():
|
||||
# Wenn noch keine Instanz da ist, prüfen wir ob eine gerade erstellt wird
|
||||
req_client, req_col = _get_collection("instance_requests")
|
||||
try:
|
||||
pending_request = req_col.find_one({
|
||||
"user_id": user_id,
|
||||
"provision_status": {"$in": ["pending", "in_progress"]}
|
||||
})
|
||||
pending_query = {
|
||||
"provision_status": {"$in": ["pending", "in_progress"]},
|
||||
}
|
||||
if user_id:
|
||||
pending_query["$or"] = [
|
||||
{"user_id": user_id},
|
||||
{"username": username},
|
||||
]
|
||||
else:
|
||||
pending_query["username"] = username
|
||||
pending_request = req_col.find_one(pending_query)
|
||||
finally:
|
||||
req_client.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user