RequestionChange, PreferredSadiksChange, DocumentsChange, \ Queue, RequestionStatusChange, SetIdentityDocument, FindProfileForRequestion, \ EmbedRequestionToProfile, GenerateBlank from sadiki.operator.views.sadik import SadikListWithGroups, SadikGroupChangePlaces, \ RequestionListEnrollment, SadikInfoChange if settings.FACILITY_STORE == settings.FACILITY_STORE_YES: change_benefits_view = BenefitsChange.as_view() else: change_benefits_view = BenefitCategoryChange.as_view() urlpatterns = patterns('', # Общие функции url(r'^$', FrontPage.as_view(), name='operator_frontpage'), url(r'^queue/$', Queue.as_view(), name='operator_queue'), url(r'^registration/$', Registration.as_view(), name=u'operator_registration'), url(r'^requestion_search/$', RequestionSearch.as_view(), name=u'operator_requestion_search'), # Работа с конкретной заявкой url(r'^request/(?P<requestion_id>\d{1,7})/$', RequestionInfo.as_view(), name=u'operator_requestion_info'), url(r'^request/(?P<requestion_id>\d{1,7})/change_profile/$', ProfileChange.as_view(), name=u'operator_profile_change'), url(r'^request/(?P<requestion_id>\d{1,7})/benefits/$', change_benefits_view, name=u'operator_benefits_change'), url(r'^request/(?P<requestion_id>\d{1,7})/edit/$', RequestionChange.as_view(), name=u'operator_requestion_change'), url(r'^request/(?P<requestion_id>\d{1,7})/sadiks/$', PreferredSadiksChange.as_view(), name=u'operator_preferredsadiks_change'),
def registration(request, *args, **kwargs): if request.user.is_authenticated() and request.user.is_operator(): return OperatorRegistration.as_view()(request, *args, **kwargs) else: return AnonymRegistration.as_view()(request, *args, **kwargs)