Skip to content

Commit 56d8b0a

Browse files
committed
addressing @josenavas comments
1 parent 0af93ff commit 56d8b0a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

qiita_db/study.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,15 +1137,15 @@ def unshare(self, user):
11371137
qdb.sql_connection.TRN.add(sql, [self._id, user.id])
11381138
qdb.sql_connection.TRN.execute()
11391139

1140-
def add_tags(self, user, tags):
1140+
def updata_tags(self, user, tags):
11411141
"""Sets the tags of the study
11421142
11431143
Parameters
11441144
----------
11451145
user: User object
1146-
The user to unshare the study with
1146+
The user reqesting the study tags update
11471147
tags : list of str
1148-
The tags to add to the study
1148+
The tags to update within the study
11491149
11501150
Returns
11511151
-------
@@ -1180,7 +1180,7 @@ def add_tags(self, user, tags):
11801180
if user_level != 'admin':
11811181
admin_tags = to_add & system_tags_admin
11821182
if admin_tags:
1183-
message += ('Only admins can assing: '
1183+
message += ('Only admins can assign: '
11841184
'%s' % ', '.join(admin_tags))
11851185
to_add = to_add - admin_tags
11861186

qiita_db/test/test_study.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -855,19 +855,19 @@ def test_study_tags(self):
855855
# assigning the tags to study as user
856856
study = qdb.study.Study(1)
857857
tags = ['this is my tag', 'actual GOLD!']
858-
message = study.add_tags(user, tags)
858+
message = study.updata_tags(user, tags)
859859
self.assertItemsEqual(study.tags, tags[:1])
860-
self.assertEqual(message, 'Only admins can assing: actual GOLD!')
860+
self.assertEqual(message, 'Only admins can assign: actual GOLD!')
861861
# now like admin
862-
message = study.add_tags(admin, tags)
862+
message = study.updata_tags(admin, tags)
863863
self.assertItemsEqual(study.tags, tags)
864864
self.assertEqual(message, '')
865865

866866
# cleaning tags
867-
message = study.add_tags(user, [])
867+
message = study.updata_tags(user, [])
868868
self.assertEqual(study.tags, ['actual GOLD!'])
869869
self.assertEqual(message, 'You cannot remove: actual GOLD!')
870-
message = study.add_tags(admin, [])
870+
message = study.updata_tags(admin, [])
871871
self.assertEqual(study.tags, [])
872872
self.assertEqual(message, '')
873873

qiita_pet/handlers/api_proxy/studies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def study_tags_patch_request(user_id, study_id,
384384
study = Study(study_id)
385385

386386
if attribute == 'tags':
387-
message = study.add_tags(User(user_id), req_value)
387+
message = study.updata_tags(User(user_id), req_value)
388388
return {'status': 'success',
389389
'message': message}
390390
else:

0 commit comments

Comments
 (0)