This is an automated email from the ASF dual-hosted git repository.

gcruz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new d9a300ea7 dc/8591 Remove Skype field, form and references, update 
twitter to X
d9a300ea7 is described below

commit d9a300ea7e614be6078692c292c6900842409d83
Author: Daniel Castillo <[email protected]>
AuthorDate: Thu Dec 4 19:46:52 2025 +0000

    dc/8591 Remove Skype field, form and references, update twitter to X
---
 Allura/allura/controllers/auth.py                     | 14 +-------------
 Allura/allura/ext/admin/widgets.py                    |  2 +-
 .../templates/sections/personal-data.html             |  5 -----
 Allura/allura/ext/user_profile/user_main.py           |  1 -
 Allura/allura/lib/plugin.py                           |  9 ---------
 Allura/allura/lib/validators.py                       |  8 ++++----
 Allura/allura/lib/widgets/forms.py                    | 19 +------------------
 Allura/allura/model/auth.py                           |  2 --
 Allura/allura/templates/user_contacts.html            |  5 -----
 Allura/allura/tests/functional/test_admin.py          |  2 +-
 Allura/allura/tests/functional/test_auth.py           | 12 +++---------
 Allura/allura/tests/functional/test_rest.py           |  1 -
 Allura/allura/tests/model/test_auth.py                |  1 -
 Allura/development.ini                                |  2 +-
 Allura/docs/api-rest/allura-api.yaml                  |  5 -----
 15 files changed, 12 insertions(+), 76 deletions(-)

diff --git a/Allura/allura/controllers/auth.py 
b/Allura/allura/controllers/auth.py
index 76b02db19..fee01427a 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -84,7 +84,6 @@ class F:
     remove_socialnetwork_form = forms.RemoveSocialNetworkForm()
     add_telnumber_form = forms.AddTelNumberForm()
     add_website_form = forms.AddWebsiteForm()
-    skype_account_form = forms.SkypeAccountForm()
     remove_textvalue_form = forms.RemoveTextValueForm()
     add_timeslot_form = forms.AddTimeSlotForm()
     remove_timeslot_form = forms.RemoveTimeSlotForm()
@@ -1107,13 +1106,12 @@ def add_social_network(self, **kw):
         require_authenticated()
 
         validator_map = {
-            'Twitter': V.TwitterValidator(),
+            'X': V.XValidator(),
             'Instagram': V.InstagramValidator(),
             'Facebook': V.FacebookValidator(),
             'Mastodon': V.FediverseValidator(),
             'Linkedin': V.LinkedinValidator(),
         }
-
         try:
             Validator = validator_map.get(kw['socialnetwork'])
             kw['accounturl'] = Validator().to_python(kw['accounturl'])
@@ -1172,16 +1170,6 @@ def remove_webpage(self, **kw):
         flash('Your personal contacts were successfully updated!')
         redirect('.')
 
-    @expose()
-    @require_post()
-    @validate(F.skype_account_form, error_handler=index)
-    def skype_account(self, **kw):
-        require_authenticated()
-        c.user.set_pref('skypeaccount', kw['skypeaccount'])
-        flash('Your personal contacts were successfully updated!')
-        redirect('.')
-
-
 class UserAvailabilityController(BaseController):
 
     def _check_security(self):
diff --git a/Allura/allura/ext/admin/widgets.py 
b/Allura/allura/ext/admin/widgets.py
index fe97dda04..f2ecf027a 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -221,7 +221,7 @@ class fields(ew_core.NameList):
             attrs=(dict(placeholder='UA-123456-0', 
pattern='UA-[0-9]+-[0-9]+')))
         twitter_handle = ew.InputField(
             field_type="text", label='X Handle',
-            validator=V.TwitterValidator)
+            validator=V.XValidator)
 
         facebook_page = ew.InputField(field_type="text", label='Facebook page',
                                       validator=V.FacebookValidator)
diff --git 
a/Allura/allura/ext/user_profile/templates/sections/personal-data.html 
b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
index 5c9fc6ea6..6efd91637 100644
--- a/Allura/allura/ext/user_profile/templates/sections/personal-data.html
+++ b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
@@ -54,11 +54,6 @@
             {{user.get_pref('telnumbers')|join(', ')}}
         </dd>
         {% endif %}
-        {% if user.get_pref('skypeaccount') %}
-        <dt>Skype:</dt><dd>
-            {{user.get_pref('skypeaccount')}}
-        </dd>
-        {% endif %}
         {% if user.get_pref('webpages') %}
         <dt>Web Site{% if user.get_pref('webpages')|length > 1 %}s{% endif 
%}:</dt><dd>
             <ol>
diff --git a/Allura/allura/ext/user_profile/user_main.py 
b/Allura/allura/ext/user_profile/user_main.py
index 416436dfe..4e6e253dc 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -307,7 +307,6 @@ def __json__(self):
             localization=self.user.get_pref('localization')._deinstrument(),
             sex=self.user.get_pref('sex'),
             telnumbers=self.user.get_pref('telnumbers')._deinstrument(),
-            skypeaccount=self.user.get_pref('skypeaccount'),
             webpages=self.user.get_pref('webpages')._deinstrument(),
             availability=self.user.get_pref('availability')._deinstrument())
 
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 15b6bd616..216d516e2 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -1513,15 +1513,6 @@ def add_website_form(self):
         from allura.lib.widgets.forms import AddWebsiteForm
         return AddWebsiteForm()
 
-    @LazyProperty
-    def skype_account_form(self):
-        '''
-        :return: None, or an easywidgets Form to render on the user 
preferences page to
-                 allow setting the user's Skype account.
-        '''
-        from allura.lib.widgets.forms import SkypeAccountForm
-        return SkypeAccountForm()
-
     @LazyProperty
     def remove_textvalue_form(self):
         '''
diff --git a/Allura/allura/lib/validators.py b/Allura/allura/lib/validators.py
index 08586706f..1b57a9981 100644
--- a/Allura/allura/lib/validators.py
+++ b/Allura/allura/lib/validators.py
@@ -513,12 +513,12 @@ def _convert_to_python(self, value, state):
         return value
 
 
-class TwitterValidator(fev.FancyValidator):
+class XValidator(fev.FancyValidator):
     def _convert_to_python(self, value, state):
         if value.startswith('@') and not re.match(FEDIVERSE_REGEX, value):
-            value = f'https://twitter.com/{value.replace("@", "")}'
-        elif not value.startswith('http') or 'twitter.com' not in value:
-            raise fe.Invalid('Invalid Twitter address', value, state)
+            value = f'https://x.com/{value.replace("@", "")}'
+        elif not value.startswith('http') or 'x.com' not in value:
+            raise fe.Invalid('Invalid X address', value, state)
         return value
 
 
diff --git a/Allura/allura/lib/widgets/forms.py 
b/Allura/allura/lib/widgets/forms.py
index b3086f992..59cd1c0f0 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -377,22 +377,6 @@ def display(self, **kw):
         self.fields['newwebsite'].attrs['value'] = initial_value
         return super(ForgeForm, self).display(**kw)
 
-
-class SkypeAccountForm(ForgeForm):
-    defaults = dict(ForgeForm.defaults)
-
-    class fields(ew_core.NameList):
-        skypeaccount = ew.TextField(
-            label='Skype account',
-            attrs={'value': ''},
-            validator=V.UnicodeString(not_empty=False))
-
-    def display(self, **kw):
-        initial_value = kw.get('initial_value', '')
-        self.fields['skypeaccount'].attrs['value'] = initial_value
-        return super(ForgeForm, self).display(**kw)
-
-
 class RemoveTextValueForm(ForgeForm):
     defaults = dict(ForgeForm.defaults, submit_text=None, show_errors=False)
 
@@ -435,9 +419,8 @@ class AddSocialNetworkForm(ForgeForm):
     @property
     def fields(self):
         socialnetworks = aslist(tg.config.get('socialnetworks',
-                                              ['Facebook', 'Linkedin', 
'Twitter',]),
+                                              ['Facebook', 'Linkedin', 'X',]),
                                 ',')
-
         return [
             ew.SingleSelectField(
                 name='socialnetwork',
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index ed9bbac22..81f1166e4 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -314,7 +314,6 @@ class __mongometa__:
     # Additional contacts
     socialnetworks = FieldProperty([dict(socialnetwork=str, accounturl=str)])
     telnumbers = FieldProperty([str])
-    skypeaccount = FieldProperty(str)
     webpages = FieldProperty([str])
 
     # Skills list
@@ -365,7 +364,6 @@ def index(self):
             timezone_s=self.get_pref('timezone'),
             socialnetworks_t=socialnetworks,
             telnumbers_t=' '.join([t for t in self.get_pref('telnumbers') if 
t]),
-            skypeaccount_s=self.get_pref('skypeaccount'),
             webpages_t=' '.join([p for p in self.get_pref('webpages') if p]),
             skills_t=' '.join([s['skill'].fullpath for s in self.get_skills() 
if s.get('skill')]),
             last_access_login_date_dt=self.last_access['login_date'],
diff --git a/Allura/allura/templates/user_contacts.html 
b/Allura/allura/templates/user_contacts.html
index 20d653335..2bf6cfba2 100644
--- a/Allura/allura/templates/user_contacts.html
+++ b/Allura/allura/templates/user_contacts.html
@@ -28,11 +28,6 @@
   {{ super() }}
   <div class="grid-20">
     <h2>Personal Contacts</h2>
-    <h3>Skype account</h3>
-
-    {{g.theme.skype_account_form.display(action="skype_account",
-          initial_value=c.user.get_pref('skypeaccount'))}}
-
     {%if c.user.get_pref('socialnetworks') or c.user.get_pref('telnumbers') or 
c.user.get_pref('webpages') %}
       <h3>Other existing contacts</h3>
         <table>
diff --git a/Allura/allura/tests/functional/test_admin.py 
b/Allura/allura/tests/functional/test_admin.py
index 2315ed277..8af17b513 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -981,7 +981,7 @@ def test_social_networks(self):
         assert resp.status_int == 200
 
         # valid Twitter
-        resp = self.app.post('/admin/update', params={'twitter_handle': 
'https://twitter.com/sourceforge'})
+        resp = self.app.post('/admin/update', params={'twitter_handle': 
'https://x.com/sourceforge'})
         assert resp.status_int == 302
         resp = self.app.post('/admin/update', params={'twitter_handle': 
'@sourceforge'})
         assert resp.status_int == 302
diff --git a/Allura/allura/tests/functional/test_auth.py 
b/Allura/allura/tests/functional/test_auth.py
index 5d3e920a0..d26fd25ef 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -1319,14 +1319,8 @@ def test_contacts_not_allowed(self):
 
     @td.with_user_project('test-admin')
     def test_contacts(self):
-        # Add skype account
-        testvalue = 'testaccount'
+        # Get page
         self.app.get('/auth/user_info/contacts/')
-        self.app.post('/auth/user_info/contacts/skype_account',
-                      params=dict(skypeaccount=testvalue, 
_csrf_token=self.app.cookies['_csrf_token']))
-        user = M.User.query.get(username='test-admin')
-        assert user.skypeaccount == testvalue
-
         # Add social network account
         socialnetwork = 'Facebook'
         accounturl = 'http://www.facebook.com/test'
@@ -1341,8 +1335,8 @@ def test_contacts(self):
         assert user.socialnetworks[0].accounturl == accounturl
 
         # Add second social network account
-        socialnetwork2 = 'Twitter'
-        accounturl2 = 'https://twitter.com/test'
+        socialnetwork2 = 'X'
+        accounturl2 = 'https://x.com/test'
         self.app.post('/auth/user_info/contacts/add_social_network',
                       params=dict(socialnetwork=socialnetwork2,
                                   accounturl='@test',
diff --git a/Allura/allura/tests/functional/test_rest.py 
b/Allura/allura/tests/functional/test_rest.py
index 9459ff40c..becb5684b 100644
--- a/Allura/allura/tests/functional/test_rest.py
+++ b/Allura/allura/tests/functional/test_rest.py
@@ -690,7 +690,6 @@ def test_profile_data(self):
         assert 'projects' in json
         assert 'sex' in json
         assert 'skills' in json
-        assert 'skypeaccount' in json
         assert 'socialnetworks' in json
         assert 'telnumbers' in json
         assert 'webpages' in json
diff --git a/Allura/allura/tests/model/test_auth.py 
b/Allura/allura/tests/model/test_auth.py
index 36a7727cf..ae9f20d02 100644
--- a/Allura/allura/tests/model/test_auth.py
+++ b/Allura/allura/tests/model/test_auth.py
@@ -393,7 +393,6 @@ def test_user_index(self):
         assert 'timezone_s' in idx
         assert 'socialnetworks_t' in idx
         assert 'telnumbers_t' in idx
-        assert 'skypeaccount_s' in idx
         assert 'webpages_t' in idx
         assert 'skills_t' in idx
         assert 'last_access_login_date_dt' in idx
diff --git a/Allura/development.ini b/Allura/development.ini
index 2405801b8..3774d6a23 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -221,7 +221,7 @@ auth.allow_birth_date = true
 auth.allow_non_primary_email_password_reset = true
 auth.require_email_addr = true
 ; List of social network options to use on user account settings
-socialnetworks = Facebook, Linkedin, Twitter, Instagram, Mastodon
+socialnetworks = Facebook, Linkedin, X, Instagram, Mastodon
 
 ; Allow uploading ssh key, optionally set ssh preferences url
 auth.allow_upload_ssh_key = false
diff --git a/Allura/docs/api-rest/allura-api.yaml 
b/Allura/docs/api-rest/allura-api.yaml
index 37e863f33..07a97813d 100644
--- a/Allura/docs/api-rest/allura-api.yaml
+++ b/Allura/docs/api-rest/allura-api.yaml
@@ -3834,7 +3834,6 @@ paths:
                   last_updated: 2015-07-28T16:40:57.701Z
                   name: Apache Alluraâ„¢
                   summary: Forge software for hosting software projects
-              skypeaccount: null
             type: object
             properties:
               username:
@@ -3983,10 +3982,6 @@ paths:
                     summary:
                       title: Project Summary.
                       type: string
-              skypeaccount:
-                title: Skype Account.
-                description: Skype account username.
-                type: string
       parameters:
         - $ref: '#/parameters/trait:bearerAuth:Authorization'
     parameters:

Reply via email to