Skip to content

Commit 900a2fa

Browse files
committed
change Forum.monitoring_email to encrypted only NEEDS MIGRATION
1 parent beebd6f commit 900a2fa

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

ForgeDiscussion/forgediscussion/model/forum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from tg import tmpl_context as c
2323
from ming import schema
2424
from ming.utils import LazyProperty
25-
from ming.odm import FieldProperty, RelationProperty, ForeignIdProperty, Mapper
25+
from ming.odm import FieldProperty, RelationProperty, ForeignIdProperty, Mapper, DecryptedProperty
2626

2727
from tg import config as tg_config
2828

@@ -56,7 +56,7 @@ class __mongometa__:
5656
posts = RelationProperty('ForumPost', via='discussion_id')
5757
members_only = FieldProperty(bool, if_missing=False)
5858
anon_posts = FieldProperty(bool, if_missing=False)
59-
monitoring_email = FieldProperty(str, if_missing=None)
59+
monitoring_email = DecryptedProperty(str, 'monitoring_email_encrypted')
6060
monitoring_email_encrypted = FieldProperty(schema.Binary)
6161

6262
@classmethod
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
#!/bin/bash
21+
set -euo pipefail
22+
23+
BASEDIR=$(dirname "$0")
24+
ALLURA_DIR=$(realpath "$BASEDIR/../../Allura")
25+
cd "$ALLURA_DIR"
26+
27+
# get INI from environment or prompt for input:
28+
INI=${INI:-}
29+
if [ -z "$INI" ]; then
30+
read -rp "Enter the path to the Allura INI file (or provide as env var): " INI
31+
fi
32+
33+
paster script $INI ../scripts/convert_encrypted_field.py -- --remove-unencrypted forgediscussion.model.forum.Forum monitoring_email

0 commit comments

Comments
 (0)