Commit da3216be authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Remove code handling UserSetting

Keep UserSetting model; to be removed in a future version.
parent f6586be4
......@@ -65,7 +65,7 @@ from astakos.im.settings import (
from astakos.im.notifications import build_notification, NotificationError
from astakos.im.models import (
AstakosUser, Invitation, ProjectMembership, ProjectApplication, Project,
UserSetting, Chain, new_chain)
Chain, new_chain)
from astakos.im.quotas import (qh_sync_user, get_pending_app_quota,
register_pending_apps, qh_sync_project,
qh_sync_locked_users, get_users_for_update,
......@@ -839,29 +839,6 @@ def get_by_chain_or_404(chain_id):
return None, application
def get_user_setting(user_id, key):
try:
setting = UserSetting.objects.get(
user=user_id, setting=key)
return setting.value
except UserSetting.DoesNotExist:
return getattr(settings, key)
def set_user_setting(user_id, key, value):
try:
setting = UserSetting.objects.get_for_update(
user=user_id, setting=key)
except UserSetting.DoesNotExist:
setting = UserSetting(user_id=user_id, setting=key)
setting.value = value
setting.save()
def unset_user_setting(user_id, key):
UserSetting.objects.filter(user=user_id, setting=key).delete()
def _partition_by(f, l):
d = {}
for x in l:
......
......@@ -78,11 +78,6 @@ class Command(SynnefoCommand):
raise CommandError(msg)
for user in users:
settings_dict = {}
settings = user.settings()
for setting in settings:
settings_dict[setting.setting] = setting.value
kv = OrderedDict(
[
('id', user.id),
......
......@@ -755,9 +755,6 @@ class AstakosUser(User):
return False
return True
def settings(self):
return UserSetting.objects.filter(user=self)
class AstakosUserAuthProviderManager(models.Manager):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment