X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/0bf7a855000b99350fce021dc8fe1bf59ceece20..9bea91a74f63f694e5497f38998730e6f8ada1c5:/forum/authentication/__init__.py diff --git a/forum/authentication/__init__.py b/forum/authentication/__init__.py index f6e14b7..79c47a8 100644 --- a/forum/authentication/__init__.py +++ b/forum/authentication/__init__.py @@ -8,7 +8,8 @@ class ConsumerAndContext: self.id = id self._consumer = consumer - context.id = id + if context: + context.id = id self.context = context @property @@ -27,32 +28,7 @@ contexts = dict([ ]) AUTH_PROVIDERS = dict([ - (name, ConsumerAndContext(name, consumers[name], contexts[name])) for name in consumers.keys() - if name in contexts + (name, ConsumerAndContext(name, consumers[name], contexts.get(name, None))) for name in consumers.keys() ]) -#todo: probably this don't belong here, also this post_stored routine needs a lot of work -user_logged_in = django.dispatch.Signal(providing_args=["user", "old_session"]) -user_updated = django.dispatch.Signal(providing_args=["instance", "updated_by"]) - -#def post_stored_anonymous_content(user,old_session,**kwargs): -# from forum.models import AnonymousQuestion, AnonymousAnswer -# aq_list = AnonymousQuestion.objects.filter(session_key = old_session) -# aa_list = AnonymousAnswer.objects.filter(session_key = old_session) -# import settings -# if settings.EMAIL_VALIDATION == 'on':#add user to the record -# for aq in aq_list: -# aq.author = user -# aq.save() -# for aa in aa_list: -# aa.author = user -# aa.save() -# #maybe add pending posts message? -# else: #just publish the questions -# for aq in aq_list: -# aq.publish(user) -# for aa in aa_list: -# aa.publish(user) -# -#user_logged_in.connect(post_stored_anonymous_content) \ No newline at end of file