Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7023)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7024)
@@ -917,4 +917,13 @@
     @grok.action('Create ticket')
     def createTicket(self, **data):
+        p_category = data['p_category']
+        student = self.context.__parent__
+        if p_category == 'bed_allocation' and student[
+            'studycourse'].current_session != grok.getSite()[
+            'configuration'].accommodation_session:
+                self.flash(
+                    'Your current session does not match accommodation session.')
+                self.redirect(self.url(self.context))
+                return
         payment = createObject(u'waeup.StudentOnlinePayment')
         self.applyData(payment, **data)
@@ -923,5 +932,5 @@
         payment.p_id = "p%s" % timestamp
         pay_details  = self.getPaymentDetails(
-            data['p_category'],self.context.__parent__)
+            p_category,student)
         if pay_details['error']:
             self.flash(pay_details['error'])
Index: /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 7023)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py	(revision 7024)
@@ -863,4 +863,12 @@
         self.browser.getControl("Add online payment ticket").click()
         self.browser.getControl(name="form.p_category").value = ['bed_allocation']
+        # If student is not in accommodation session, payment cannot be processed
+        self.app['configuration'].accommodation_session = 2011
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...Your current session does not match...',
+                           self.browser.contents)
+        self.app['configuration'].accommodation_session = 2004
+        self.browser.getControl("Add online payment ticket").click()
+        self.browser.getControl(name="form.p_category").value = ['bed_allocation']
         self.browser.getControl("Create ticket").click()
         ctrl = self.browser.getControl(name='val_id')
